Thursday, January 13, 2011

Can't display error document : apache 2

My httpd.conf is ..

<VirtualHost *:80>
ServerName example.com
DocumentRoot /path/to/dir/

ErrorDocument 403 /my403.html
ErrorDocument 404 /my404.html
ErrorDocument 500 /my500.html

<Directory "/path/to/dir/ ">
AllowOverride None
Options -Indexes
Order deny,allow
Deny from all
<FilesMatch "\.(JPG|jpg|jpeg|gif|png|css)$">
allow from all
</FilesMatch>
</Directory>

</VirtualHost>

In the deep page of the hierarchy (/path/to/dir/) being displayed default page What's wrong

access log is

client denied by server configuration: /path/to/dir/my403.html

  • You've don't have html files in the list of allowed files, so they are denied by default. This includes your custom error pages, so those don't show up either!

    I would create a separate subdirectory for your error pages, and specifically allow html pages to be served from that subdir.

    From Joe

0 comments:

Post a Comment