mod_rewrite
engine strips all double slashes to single ones in RewriteRule
so you cannot match http://www
in RewriteRule
. Use RewriteCond
instead with THE_REQUEST
parameter.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{THE_REQUEST} \s/+(\S+)
RewriteRule ^ /index.php?q=%1 [L,QSA]