Reputation: 69
I am currently using
RewriteRule ^(.*).html$ location.php?cmd=$1 [L]
to redirect all .html
page requests via a dynamic page - location.php
.
How I can add exceptions to allow 2 or 3 pages to not be affected by this rule eg. index.html aboutus.html etc. thanks.
Upvotes: 0
Views: 49
Reputation: 784998
Replace your code with:
RewriteCond %{REQUEST_URI} !^/(index|aboutus|contact)\.html$ [NC=
RewriteRule ^(.+?)\.html$ /location.php?cmd=$1 [L]
Upvotes: 0
Reputation: 3163
Place these lines at the top of your .htaccess file to skip to existing files and directories if they exist. If not, proccess our other rules as usual.
RewriteCond %{REQUEST_FILENAME} -f [NC,OR]
RewriteCond %{REQUEST_FILENAME} -d [NC]
RewriteRule .* - [L]
Upvotes: 1