PDA

View Full Version : Index.htm Required??


TCasp77
2003-09-14, 02:03 AM
I finally got some one of my sites up and running, and I have learned a lot in the process. One thing that is bugging me a little is that the URL of the site is only responding when you point to the index page, such as www.mydomain.com/index.htm, instead of automatically jumping right to the index page in the first place, like it used to. Any reasons for this? I'm hoping its just something simple that I have overlooked. My directory structure is set up as follows: /var/www/html/mysite_1. I will have 2 more sites going up on this server in the next few weeks, and those will be /var/www/html/mysite_2, and /var/www/html/mysite_3....is this a decent way to do things? Thanks for the help!

Tom

Jose
2003-09-14, 12:16 PM
If I remember right, Apache is set up to 'pick up' .html and not htm. You may need to add the .htm extension in apache httpd.conf file look for "DirectoryIndex" and add index.htm. Remember that htm and html are not seen as the being the same thing by apache.

dhigbee
2003-09-14, 12:31 PM
To echo a bit of what Jose said and to add some more...

A simple answer to your problem is to delete any other index.xxx files. A more permenant answer is to edit the httpd.conf file. The fact that index.htm is not coming up at all may indicate there is a problem with the DirectoryIndex section or you don't have DirectoryIndex in your httpd.conf file.

The way DirectoryIndex works, is that when you navigate to a directory, apache will look for the file name listed as the first entry in the DirectoryIndex section. If not found, it will look for the second, then the third and so on.

To edit httpd.conf file, you must be root. If you do not know where the file is, enter: locate httpd.conf. Under the DirectoryIndex section, enter index.htm as the first entry or move it to be the first entry.

As an example, here is my DirectoryIndex entry. It about covers it all:

DirectoryIndex index.html index.htm index.shtml index.php index.php4 index.php3 index.phtml index.cgi default.htm

As far as your directory structure, yes, this is the proper method.

Don

TCasp77
2003-09-14, 21:33 PM
Thanks a lot guys! This worked beautifully, and I can't believe I overlooked it!!

Tom