Answers for ".htaccess to remove .php"

PHP
2

php remove extension from url

//put this piece of code in the root file .htaccess
RewriteEngine on
#remove extension html
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html [NC,L]

#remove extension php
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^(.*)$ $1.php
Posted by: Guest on October-22-2020
0

Remove .php htaccess

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]
Posted by: Guest on August-07-2021

Browse Popular Code Answers by Language