I have a code in my .htaccess file:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /.*.html HTTP/
RewriteRule ^(.*).html$ /$1 [R=301,L]
It removes .html extension from urls, how do I remove .php as well with the same code?
I have a code in my .htaccess file:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /.*.html HTTP/
RewriteRule ^(.*).html$ /$1 [R=301,L]
It removes .html extension from urls, how do I remove .php as well with the same code?
2
Answers
I am sure there’s a shorter way to solve this out there but in this is how I remove php extension at the moment:
Update:
Try this since you would like to main existing code
Check this modified rule