Ad

Mod_rewrite Rewrite All But Index.php

- 1 answer

In my htaccess i have

RewriteRule ^([^/]+)/?$ cms.php?seotitle=$1 [L]

The idea is that index.html will load fine and then anything requested at domain.com/anythinghere.html will use the rule of grabbing the file from cms.php.

However its not working - any clues? Really need this sorted asap.

Ad

Answer

Try this rule:

RewriteCond $1 !^(cms\.php|index\.html)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ cms.php?seotitle=$1 [L]
Ad
source: stackoverflow.com
Ad