Abdul Waheed Abdul Waheed - 3 months ago 10
PHP Question

Url rewriting to hide .html and .php from all project files

i have few pages i my project they are:

index.php
aboutus.php
signup.html
login.html


I want to show in url without.php or .html
i tried with this code:

RewriteEngine On
RewriteCond %{http://www.example.net/project name/index.php} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^([^\.]+)$ $1.html [NC,L]


this is not working

Answer
RewriteEngine on
RewriteBase /
RewriteCond %{http://www.ameryprod.com/index.html} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^.]+)\.html$ http://www.ameryprod.com/$1 [R=301,L]

Finally i found this solution hope it works for you as well.