0

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

Mr world wide
  • 4,696
  • 7
  • 43
  • 97

2 Answers2

1

Try this working for me

RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f [NC] 
RewriteRule ^(.*?)$ $1.php [L]
RewriteCond %{REQUEST_FILENAME}.html -f [NC] 
RewriteRule ^(.*?)/?$ $1.html [L]
Abhishek Gurjar
  • 7,426
  • 10
  • 37
  • 45
0
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.

Mr world wide
  • 4,696
  • 7
  • 43
  • 97