Forum Moderators: phranque

Message Too Old, No Replies

index.php doesn't show, when opening a particular folder.

Unable to showcase an index.php file on the apache server.

         

bramcorleone

12:20 pm on May 11, 2008 (gmt 0)

10+ Year Member



In general, when visiting the homepage of a website, which is partially/entirely driven by lets say php, you'll most likely get to see the 'index.php' page.

The apache server on my own computer apparantly isn't configured to do this. I get to see a list of files, located in a particular folder, which I open through localhost. This isn't the case with index.htm(l) files, whereas those will just been shown!

Can anyone help me out here? I know I have to look somewhere in the 'php.ini' file or at the 'mime types', but I don't know exactly what to look for.

encyclo

1:06 pm on May 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You will need to look for the httpd.conf file in your local Apache installation. You simply need to modify the DirectoryIndex [httpd.apache.org] to allow for the index.php file:

DirectoryIndex index.php index.html index.htm

g1smd

4:08 pm on May 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In addition, you would be wise to redirect requests for index.html and index.htm and index.php back to a URL that ends with the previous trailing slash. Use a 301 redirect.

Code for that was posted here several times in the last week.

bramcorleone

9:27 pm on May 11, 2008 (gmt 0)

10+ Year Member



Everything works fine. Thanks for your help!

I shall look into 301 redirects, have been planning to learn more about those already.