I want to hide my file extensions in browser to be displayed, like http://www.example.com/dir/abc.php
should be displayed as http://www.example.com/dir/abc
only.
i wrote following rewriteCond and rewrite rule on .htaccess
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ /$1.php [L,QSA]
but this code doeesn't seems to helping me.
EDIT:
this is complete code of my htaccess file
Options -Indexes
ErrorDocument 403 /errors/403.php
ErrorDocument 404 /errors/404.php
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www.)?127.0.0.1 [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?127.0.0.1.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?localhost [NC]
RewriteCond %{HTTP_REFERER} !^http://(www.)?localhost.*$ [NC]
RewriteRule .(js|css|jpg|png)$ - [F]
RewriteEngine on
RewriteRule ^(.*).[d]{10}.(css|js|png|jpg)$ $1.$2 [L]
RewriteEngine On
# To externally redirect /dir/file.php to /dir/file
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}s/+(.+?).php[s?] [NC]
RewriteRule ^ /%1 [R=301,L,NE]
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…