Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I've recently been tasked to code a new site. The following is the URL for the site:

http://www.iss.guild.uwa.edu.au/2011/

As you can see going to the above URL will only lists the available files and folders in it. I want to get the server to autoload the index.html file like in www.iss.guild.uwa.edu.au/2010/

share|improve this question

1 Answer 1

up vote 2 down vote accepted

I see that your site is using apache. In the apache configuration file, add this line:

DirectoryIndex index.html

and restart apache.

share|improve this answer
    
Sorry if I'm being obtuse but how exactly do you do that? –  jon2512chua Jan 5 '11 at 8:17
    
Oh and I don't exactly have full control of the server. I'm just given the storage space, I can't touch anything else. –  jon2512chua Jan 5 '11 at 8:24
2  
Upload a file called .htaccess in the root directory with that line DirectoryIndex index.html. Note that: AllowOverride must be set to yes in the apache configuration file. If it is not, then you will have to ask the client to do one of the following 1) Put the DirectoryIndex line in the apache config and restart apache himself. 2) Atleast set AllowOverride appropriately. But first, try uploading the .htaccess file to see if it works for you –  JP19 Jan 5 '11 at 9:13
1  
It also might be worth adding Options -Indexes so that it doesn't show up the directory listing –  Piers Karsenbarg Jan 5 '11 at 10:39
    
Yup it works now thanks JP19. Oh and thanks for the tip too Piers. :) –  jon2512chua Jan 5 '11 at 13:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.