Hide Php Extension In Url

[Solved] Hide Php Extension In Url | Php - Code Explorer | yomemimo.com
Question : hide php extension in url

Answered by : kind-koala-5ttpsikzcliu

Options +MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

Source : https://alexcican.com/post/how-to-remove-php-html-htm-extensions-with-htaccess/ | Last Update : Fri, 12 Feb 21

Question : hide .php from url .htaccess

Answered by : dead-donkey-uvh14nb1sxeg

# Run Php without filename extension
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
# Return 404 if original request is .php
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]

Source : | Last Update : Fri, 13 Nov 20

Answers related to hide php extension in url

Code Explorer Popular Question For Php