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/*”

DocumentRoot c:/wamp/www/
ErrorLog c:/wamp/www/
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