Forum Moderators: phranque
^[A-Z]{3,9}\ /index GET /index.php?page=345 HTTP/1.1 incoming request.
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /demo/(index\.php)?\?page=(information|contact|store|help|about|privacy|thispage|thatpage|products)\ HTTP/
RewriteRule ^(index\.php)?$ http://www.example.com/demo/%1/? [R=301,L] example.com/index.php?something and example.com/?something to be correctly redirected. DirectoryIndex index.php index.html directive. index\.php to (index\.php)? as mentioned in my fourth post. There are four to change. ^(.+[^/])/$ may be more efficiently coded as ^(([^/]+/)*[^/.]+)/$ and you might not need the RewriteCond %{REQUEST_FILENAME} !-f line at all. ^example\.com$ to !^(www\.example\.com)?$ http://www.example.com from both lines as mentioned in my first post. You need an internal rewrite here, not an external 302 redirect. RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.(html?|php)\ HTTP/
RewriteRule ^(([^/]+/)*)index\.(html?|php)$ http://www.example.com/$1 [R=301,L]