I have a folder E:\wamp\www\world_appeal
with admin panel E:\wamp\www\world_appeal\admin
I want htaccess grammar that hide php extension for all the files of front and admin panel as well. How?
Place these 2 rules as very first rule in /world_appeal/.htaccess:
RewriteEngine on RewriteBase /world_appeal/ RewriteCond %{THE_REQUEST} /world_appeal/(.+?)\.php[\s?] [NC] RewriteRule ^ %1 [R=301,L,NE] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}/world_appeal/$1.php -f RewriteRule ^(.+?)/?$ $1.php [L] put in .htaccess in each folder
# Turn on the rewrite engine RewriteEngine on # If the request doesn't end in .php (Case insensitive) continue processing rules RewriteCond %{REQUEST_URI} !\.php$ [NC] # If the request doesn't end in a slash continue processing the rules RewriteCond %{REQUEST_URI} [^/]$ # Rewrite the request with a .php extension. L means this is the 'Last' rule RewriteRule ^(.*)$ $1.php [L]
<a href="something.php">to<a href="something">