Forum Moderators: phranque

Message Too Old, No Replies

simplest way: domain.com instead of domain.com/index.htm

i have read through a lot of previous posts . . .

         

rockdigital

11:09 pm on Apr 15, 2005 (gmt 0)

10+ Year Member



thanks for bearing with me -- i'm new to unix/apache. i want my domain, which is on a dedicated server, to resolve to the format
[maindomain.com...]
instead of
[maindomain.com...]

tech support referred me to google . . . it's kinda funny because the reason i moved to a dedicated server was specifically this reason . . . and also so that with multiple domain names pointing at a single domain name they could all resolve to the format
[maindomain.com...]

so far i have removed the "www" using an index.cgi file, but if you remove the "/index.htm", an error message is returned.

thanks in advance for your help

- dave

mack

11:38 pm on Apr 15, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Hi rockdigital Welcome to WebmasterWorld.

If you are on an apache web server then the easiest way to do this is to edit your httpd.conf file. This is your apache configuration file.

What you need to do is specify to it what file extensions you want it to class as an index document.

ALWAYS BACKUP HTTPD.CONF BEFORE MAKING ANY CHANGES!

Here is a snippet from my file...

#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.php index.cgi
</IfModule>

If you locate this section on your httpd.conf you can make sure all your required index type file extensions are listed. If not you can add them my adding a space followed by your file name. Seperate each file name with a space.

You will need to restart apache after you have made any changes. hanged only come into effect after you restart the server.

Mack.

rockdigital

12:54 am on Apr 16, 2005 (gmt 0)

10+ Year Member



actually, i figured out an easier way to do it. rename index.htm to index.html and delete index.cgi -- thanks for your help. i look forward to further adventures in apache.

mack

2:11 am on Apr 16, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



index.htm to index.html

By default apache will see index.html as a default directory index. I just like to add index.htm to the httpd.conf file so that both will work. I often find myself using either or extensions.

Mack.