Apache Server

Status
Not open for further replies.

uzi9mm

Fully Optimized
Messages
2,553
Location
Horseheads, NY
I tried hosting a website on my apache server. I do not have a domain, but I use my IP address. Is there a way when I type my IP in to automatically go to the index.htm without typing my ip and the file eg: 192.168.1.100/index.htm
 
I think the apache default is index.html rather than index.htm, so you could always rename it index.html

Alternatively you could create a .htaccess file which lists the order in which you want it to find pages e.g. find index.htm or if that is not there use index.html etc... (google for .htaccess you'll find loads)

The best option though is to edit the apache httpd.conf file. It is pretty well commented so should make sense. You want to find the line that reads DirectoryIndex and put index.htm first in the list. You'll find it at /etc/apache2/ on a linux machine but it shouldnt be too hard to find it on a windows box either assuming windows uses the httpd.conf file anyway!
 
Open your httpd.cfg file from your Apache start menu group. Once open, do a search for index.html. Replace index.html with index.htm. Save the file and restart Apache. Viola :).

-Dan The Man
 
In your configuration file you can list as many default files as you like using the DirectoryIndex directive. Apache will search for them one by one from left to right. There is no need to put just one in there. This way, you could use CGI scripts, the full .html extension, the 3 letter extension .htm, or about a dozen other possibilities and have them all work without the need to keep changing your configuration.
 
Status
Not open for further replies.
Back
Top Bottom