I have a .htaccess file in /var/www, the contents of which is: ErrorDocument 404 /404.html.

In apache2.conf AccessFileName is .htaccess , and AllowOverride does not exist. For some reason, visiting myurl.com/anything does not show 404.html.

Help greatly appreciated. ~JJ56.

link|improve this question

50% accept rate
feedback

1 Answer

You will need to configure a suitable AllowOverride setting in your configuration file to get ErrorDocument to work. The override you require is fileinfo e.g.

<Directory /var/www/>
    .
    .
    .
    AllowOverride fileinfo 
 </Directory>
link|improve this answer
I added: <Directory /var/www/> AllowOverride ALL </Directory> to apache2.conf (there was no directory thing already). And it made no difference. – JJ56 Mar 23 '11 at 8:13
@JJ56: Ok, that was an example because I don't know your configuration. You should put the AllowOverride directive within the Directory block that makes sense to your configuration. Don't forget to restart you Apache too. – Iain Mar 23 '11 at 8:22
Where is the directory block? There is none in ports.conf, apache2.conf, or httpd.conf. I added the one to apache2.conf, but 404 still dosen't work. – JJ56 Mar 23 '11 at 8:27
@JJ56: Which OS/distro are you using ? – Iain Mar 23 '11 at 8:29
ubuntu server edition 10.10 – JJ56 Mar 24 '11 at 1:47
show 2 more comments
feedback

Your Answer

 
or
required, but never shown

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