Mod Rewrite Script

mod_rewrite is NOT a scripting language so it does not have convenient “group” notation to have RewriteCond statements applied to multiple RewriteRules. On the other hand, there is the Skip flag which tells mod_rewrite to SKIP (read GOTO) the next n RewriteRules (block statements).

Include “c:/wamp/alias/*”

ServerAdmin postmaster@microlinks.acme.com
DocumentRoot c:/wamp/www/microlinks.acme.com/htdocs
ServerName microlinks.acme.com
ErrorLog c:/wamp/www/microlinks.acme.com/logs/error_log
DirectoryIndex index.php index.htm index.html



RewriteEngine on
# Rewrite current-style URLs of the form ‘index.php?q=x’.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


Was this article helpful?

Related Articles