Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14611 reviews 1734 hosting providers

Questions & Answers

Using .htaccess to change default directory page

May 13, 2012 by sally23
I have a problem, “index.html” is getting executed by default but “index.php” is not getting executed. I want to change the default file that would be executed to “index.php”. How can I change it using .htaccess?
Please help

1 Answer

0 votes
May 13, 2012 by expert
put the following code in the .htaccess file,
DirectoryIndex index.html index.htm index.php index.cgi

First of all, “index.html” file is looked inside directory and if that file is not found then “index.htm” file is looked and if that is also not found then again seek for “index.php” and so on.