Reputation: 79
How can i rewrite my website urls as given below detail
static-page.php?statictour=agra-jaipur
to agra-jaipur.html
our code is
RewriteRule ^([a-zA-Z0-9_-]+).html$ static-page.php?statictour=$1 [NC,L]
above code working but index.html file not working when this code apply
anybody can help ?
Upvotes: 1
Views: 520
Reputation: 41219
The problem is that index.html also matches the pattern ^([A-Za-z0-9-]+).html$ and redirects to /static-page.php .
You need to exclude index.html from the rule :
RewriteCond %{REQUEST_URI} !^/index\.html$
RewriteRule ^([a-zA-Z0-9_-]+).html$ static-page.php?statictour=$1 [NC,L]
Upvotes: 1