Ad Code

Redirect .php to non php in current directory

You can use the following :

#remove the .php extention for root dir only 
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+)\.php
RewriteRule ^/?(.*)\.php$ /$1 [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^(.*?)/?$ $1.php

Post a Comment

0 Comments