I'm trying to hide extensions from my website. I use both .php
and .html
i have a .htaccess
file that hides only html, I don't know how to make it hide .php
as well .
RewriteEngine on
RewriteBase /
#Removes .html extension
RewriteCond %{THE_REQUEST} ^[A-Z]+\s.+\.html\sHTTP/.+
RewriteRule ^(.+)\.html $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
I tried to copy and paste the code next to the one that i have and replace .html
with .php
but it didn't work it gave me an error with page not found.
What should I write to hide both .php
and .html
?
EDIT: I know there are many questions about that, but i couldn't get it to work with the information that i've got from those.