hi,
I have been using PHP now for a few months or so all on my localhost webserver (Apache). I am running PHP version 4.3.9 as well as MySQL.
My problem is that I want to set index.php as my homepage on my website but testing it on my localhost it does not seem to work. How can I set my homepage to index.php rather than index.html or whatever. I know I can do this for ASP but I am unsure regarding PHP.
Any help is greatly appreciated.
Thanks for reading.
[SOLVED] Setting index.php as website homepage
Moderator: General Moderators
you could put this in a .htaccess file
apache will read from left to right,
if for example, there is not a file named index.php, then it would look for index.html, and if it cant find index.html, then it would try foo.htm etc......
thats assuming your using apache. i dont know how to do it on other webservers
Code: Select all
DirectoryIndex index.php index.html foo.htmif for example, there is not a file named index.php, then it would look for index.html, and if it cant find index.html, then it would try foo.htm etc......
thats assuming your using apache. i dont know how to do it on other webservers
rehfeld you were spot on. After a bit of Googling regarding the DirectoryIndex I found that I should go to and open:
C:\Program Files\Apache Group\Apache\conf\httpd.conf
once inside the httpd.conf I searched for DirectoryIndex and relpaced:
DirectoryIndex index.html
TO
DirectoryIndex index.php index.html
This worked perfectly. Thank you again. I hope I can help others by stating what I have done.
C:\Program Files\Apache Group\Apache\conf\httpd.conf
once inside the httpd.conf I searched for DirectoryIndex and relpaced:
DirectoryIndex index.html
TO
DirectoryIndex index.php index.html
This worked perfectly. Thank you again. I hope I can help others by stating what I have done.