Answers for "auto remove .php extension using .htaccess"

PHP
0

auto remove .php extension using .htaccess

#This code will automatically remove .php extention
#ex: it remmoves www.eample.com/xyz.php to www.example.com/xyz
RewriteEngine on
RewriteBase /
RewriteRule ^(.+)\.php$ /$1 [R,L]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ /$1.php [NC,END]

#Copy and paste the above code in .htaccess file
Posted by: Guest on June-01-2021

Code answers related to "auto remove .php extension using .htaccess"

Browse Popular Code Answers by Language