Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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>
share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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