Forum Moderators: phranque

Message Too Old, No Replies

newbie: server does not 'redirect' addr:/ to addr:/index.html

apache2

         

louvann

4:08 pm on Nov 25, 2010 (gmt 0)

10+ Year Member



I have an Apache2 server which runs three Virtual Hosts. Two of the sites do not exhibit the problem of:

problem:
Client requests [foo.com:port...] and should be served [foo.com:port...] but instead is served error page

Forbidden

You don't have permission to access / on this server.
Apache Server at 192.168.2.194 Port 8081

This is partially correct since Indexes are not allowed in the config for each Virtual Host. Options -Indexes

If the client requests [foo.com:port...] all is good.

The config for errant site has been stripped back to the basic default config but without resolving the original problem.

Where to look next?

g1smd

8:59 pm on Nov 25, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You do have this line though?

DirectoryIndex index.html

louvann

3:40 am on Nov 26, 2010 (gmt 0)

10+ Year Member



Back from the Thanksgiving festivities. Hope yours went well.

I think you have spotted the error. Two of three sites use php and then the directive is found.
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>

But the third problem Virtual host is simple html, so, I will add it within the section:
<Directory /usr/share/site >
DirectoryIndex index.html
blah
blah
</Directory

Fixed. I was looking right at it but things did not click until your post. Thank-you

g1smd

6:14 am on Nov 26, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You could use

DirectoryIndex index.php index.html


which looks for the .php file first and if it is not found, looks for the .html file next.