Question
Hide .php dont work
Hello, I have a question, I am trying to hide .php with .htaccess in Centos 7 but it is not working. Would you help me?
My code .htaccess:
Options +MultiViews
Run Php without filename extension
RewriteEngine on
RewriteCond %{REQUESTFILENAME} !-d
RewriteCond %{REQUESTFILENAME}.php -f
RewriteRule ^(.*)$ $1.php
Return 404 if original request is .php
RewriteCond %{THE_REQUEST} “^[^ ]* .?.php[? ].$”
RewriteRule .* - [L,R=404]
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×