• 24x7 Technical Support
  • +91-9999943885

How to auto remove .php extension using .htaccess

auto remove .php extension using .htaccess

#Copy and paste the Below code in .htaccess file
RewriteEngine on
RewriteBase /
RewriteRule ^(.+)\.php$ /$1 [R,L]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ /$1.php [NC,END]

For Example:- it remmoves www.domain.com/home.php to www.example.com/home