how to remove .php from the url using .htaccess

Question & AnswersCategory: PHPhow to remove .php from the url using .htaccess
Ranjith Staff asked 8 months ago

1> cretae .htaccess file in root folder use below code.

RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [NC,L]

 

Please follow and like us:

Please login and answer : Click here