What does "Directory Index forbidden by rule" mean?

Sam picture Sam · Feb 22, 2011 · Viewed 8.1k times · Source

What could the following line mean?

[Mon Feb 21 20:52:13 2011] [error] [client 66.249.71.150] 
 Directory index forbidden by rule: /var/www/vhosts/website.com/httpdocs/

I have no index.php in the root, since my index is home.php, website root file is defined by .htaccess rules:

My .htaccess file looks like this:

DirectoryIndex index.php /index.php
RewriteCond %{HTTP_HOST} ^website.com$
RewriteRule ^$ en/home [R=301,L]
...

Thanks very much!

update1:

I dont have access to the virtual host config files, im on shared hosting , so only .htacces in my /httpdocs/ thats all I have. What should I do? Should I jus disable DirectoryIndex (I dont use that anyways and the site works fine!) How can I check wether I have directory index or not?

update2:

  • when testing in browser, all seem to work fine, fast and nicely!
  • in log however, i see this:

[Sun Feb 27 02:18:56 2011] [error] [client 66.249.71.81] File does not exist: /var/www/vhosts/website.org/httpdocs/index

Unlike the first error at the top of this page, this seems a regular 404 (my 404 error document is my home page, so error pages show the home)

When I type in 'website.org' the htaccess rule does goed job in redirecting to the default page website.org/en/home and when I type 'websie.org/index' it redirects to website.org/en/home so it all seems to work fine but i dons know what the two error means "Directory index forbidden by rule..."

Clues? Thanks!

Answer

Andreas Wong picture Andreas Wong · Feb 22, 2011

Check your entries and make sure that your site's virtual host DocumentRoot is listed there, otherwise apache won't be able to get at it.