I'm running a local test-server (on Ubuntu 10.04), but for some reason I don't seem to be seeing my custom 403
/404
error messages. Here's some command output:
[ /var/www ] # ls -al
:
drwxr-xr-x 5 www-data www-data 4096 2010-07-31 18:40 .
drwxr-xr-x 16 root root 4096 2010-05-14 19:56 ..
-rwxr-xr-x 1 www-data www-data 493 2010-07-31 18:32 403.html
-rwxr-xr-x 1 www-data www-data 493 2010-07-31 18:10 404.html
-rwxr-xr-x 1 www-data www-data 56 2010-07-31 18:25 .htaccess
[ /var/www ] # cat .htaccess
:
ErrorDocument 404 /404.html
ErrorDocument 403 /403.html
I'm completely stumped - can't find any info through Google either.
I've read that the base Apache config file for the default VirtualHost in Ubuntu is to set the AllowOverride directive in the DocumentRoot directory to None instead of All. This means that .htaccess files will not be parsed and therefore your ErrorDocument directives will not be parsed.
Changing it to
AllowOverride All
should activate the ability to use .htaccess files and therefore your custom ErrorDocuments should work.See Enabling Use of Apache htaccess files on Ubuntu's help wiki or this post on UbuntuForums.org for a more detailed explanation. Hope that helps. Alternatively, you could set the ErrorDocument directive in the VirtualHost record in the Apache config file instead of an .htaccess file.