Answers for "Hide php extension in URL without htaccess"

PHP
0

hide .php from url .htaccess

# 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]
Posted by: Guest on November-06-2020

Code answers related to "Hide php extension in URL without htaccess"

Browse Popular Code Answers by Language