Using .htaccess to change default directory page

99 views
asked May 13, 2012 in General by sally23 (1,250 points)
Hello
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
thanks

1 Answer

0 like 0 dislike
answered May 13, 2012 by expert (14,380 points)
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.
...