Ad

Htaccess Mod Rewrite Home.php To Be Removed

- 1 answer

I have an index.php page which has a redirect on to go to home.php

is there anyway using htaccess i can make home.php be hidden so the user just see's the domain name in the address bar?

Ad

Answer

Yes sure you can use this rewrite rule in your DOCUMENT_ROOT/.htaccess file:

DirectoryIndex index.php

RewriteEngine On

RewriteCond %{THE_REQUEST} /index\.php [NC]
RewriteRule ^(.*?)index\.php$ /$1 [L,R=302,NC,NE]
Ad
source: stackoverflow.com
Ad