Reputation: 4095
About an hour ago, I Added
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} ^(.*[^/])/?$
RewriteCond %{DOCUMENT_ROOT}%1.php -f
RewriteRule .+ %1.php [QSA,L]
to my .htaccess
file. but It doesnt work. when I go to mywebsite.com/info or mywebsite.com/info/ it doesnt work (the page is info.php). the mod_rewrite is enabled - tested it by RewriteRule that redirected me to google from any page in my site.
I have no idea what's the problem.. maybe the code is wrong?
Thanks.
Upvotes: 4
Views: 433
Reputation: 4095
This's what I needed for the rules to work:
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)/$ $1.php [L]
Upvotes: 1
Reputation: 11
GoDaddy takes about an hour to parse your newly uploaded .htaccess file. It's strange. But the file should work fine as is if you just wait.
Upvotes: 1
Reputation: 1990
@Ron
Try changing the last two lines to this:
RewriteCond %1.php -f
RewriteRule .+ %1.php [PT]
You'll need the [PT]
in order for the PHP file to be processed correctly.
Upvotes: 2