Answer the question
In order to leave comments, you need to log in
How to remove the .php extension?
It is impossible to remove the extension in any way.
RewriteEngine On
RewriteRule ^(([^/]+/)*[^.]+)$ /$1.php [L]
Answer the question
In order to leave comments, you need to log in
RewriteCond %{REQUEST_METHOD} =GET
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteCond %{REQUEST_URI} ^(.+)\.php$
RewriteRule ^(.*)$ %1/ [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question