Forum Moderators: phranque

Message Too Old, No Replies

DirectoryIndex trouble in httpd conf file

Difficulty making changes to DirectoryIndex in the httpd conf file.

         

morcar

12:09 am on Feb 4, 2005 (gmt 0)

10+ Year Member



Hi, this is my first WebmasterWorld.com post. I am new to running Apache & have little or no UNIX background.

I just installed Apache webserver v 1.3 on my Windows XP Pro machine. Install was successful.

I next installed PHP v 4.3.10. PHP install was successful. Now I want to make my Apache webserver recognize index.php before any other index or default file - or at all, for that matter.

I have a httpd conf file and I have read a number of posts here about DirectoryIndex and mod_dir.

Currently it reads:

<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.shtml
</IfModule>

However no matter how many times & ways I have edited it, it does not recognize any other file besides index.html as the default page. If I delete index.html from my htdocs (web root) directory but leave in index.php and index.shtml, it directs instead to Apache.org's default page that says "If you can see this, it means that the installation of the Apache web server software on this system was successful...."

I have also read about the .htaccess file but I do not appear to have one of those. (Scratching head.) I have an "access" file that is a configuration type file, and it is located in my conf directory. Even though the access file comments recommend leaving this file blank, I have tried editing it to add the DirectoryIndex lines listed above but that does not work, either.

Any ideas and suggestions?

Thanks!
Morcar

kalos

5:19 am on Feb 4, 2005 (gmt 0)

10+ Year Member



Just move index.php before DirectoryIndex in that list and restart the service. Voila.

morcar

6:32 am on Feb 4, 2005 (gmt 0)

10+ Year Member



Kalos,

If by "move index.php before DirectoryIndex" you mean this:

<IfModule mod_dir.c>
index.php DirectoryIndex index.html index.shtml
</IfModule>

then unfortunately that didn't work.

If that wasn't what you meant, then can you please clarify?

Thanks!

morcar

10:29 pm on Feb 7, 2005 (gmt 0)

10+ Year Member



Does anybody else have any suggestions?

jdMorgan

11:44 pm on Feb 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try this:

AddType text/html .php
AddHandler server-parsed .php

The server does not know that it needs to parse .php files and output html unless you tell it.

See Apache mod_mime

Jim

Palehorse

6:28 am on Feb 8, 2005 (gmt 0)

10+ Year Member



index.php DirectoryIndex index.html index.shtml

try:
DirectoryIndex index.html index.shtml index.php

You where putting cart before the horse ;)