I’m using mode rewrite to make seo friendly urls. Please see the code below
Options +FollowSymLinks
RewriteEngine on
RewriteRule discover/([0-9]+)$ discover.php?page=$1 [NC,L]
RewriteRule ^([^.]+)$ $1.php [NC,L]
Code work in my local host but in the hosting server it doesn’t work.
If i added with the file extension it works in the server but without the extension it doesn’t work.
Ex: below works
RewriteRule discover-([0-9]+).html$ /discover.php?page=$1 [L]
Any pointers on how to make the 1st code it work? Appreciate your help.
2
Answers
Turn off
MultiViews
option and check for existence of.php
file before adding.php
in a request:Try this too,