Forum Moderators: phranque

Message Too Old, No Replies

Apache not showing Custom Error Pages

Apache not showing Custom Error Pages

         

thomaspark

8:49 pm on Feb 14, 2012 (gmt 0)

10+ Year Member



Hi Guys,

I have a Linux Server running Apache 2.2.22, I have some custom error pages located in the following location '/var/wwwerror/'.
This is setup as a Vertual Directory called '/error/'.

Error/
Error/404.htm
Error/401.htm
Error/500.htm

I have in my Apache Configuration the following lines
ErrorDocument 404 /error/404.htm
ErrorDocument 401 /error/401.htm
ErrorDocument 500 /error/500.htm

Now my Vertual Directory is stored in my Main HTTPD.conf file along with these lines. When I attempt to go to a directory that doesn't exsist on my server for example [servername...] I get back my browser standard Error Page. But when I don't autherize on lets say [servername...] I get back my 401 error page, but this isn't working for my 404 or 500 pages.

Does anyone have any idea's as to what is going on or what could be causing this to happen?

Any help would be great.

Regards
Thomas Park

lucy24

10:00 pm on Feb 14, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Minimalist questions first, just to eliminate the "D'oh!" issues:

In real life, are all those /error/ directory references case-sensitive?

Are you testing with MSIE and using very short custom error documents?

tangor

12:45 am on Feb 15, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is your root directory really /var/wwwerror/ ?

Usually /var/www/
Usually error docs in that directory
Usually ErrorDocument 401 401.html
from that folder would then work. Is there any reason to put error docs in their own folder?

Suggest commenting out all above and see if your setuo returns the default error response then go from there.

lucy24

1:34 am on Feb 15, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is there any reason to put error docs in their own folder?

You mean other than to reduce the clutter that comes from having all those top-level files lying around loose? You've already got robots.txt, .htaccess, the favicon, possibly a sitemap, a separate validation file for each Webmaster Tools you use...

tangor

2:06 am on Feb 15, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I mean that every folder inserted forces down the listing... among other things. But more sincerely, some documents just work more logically from the top down. It's a matter of choice, both work... if paths are proper and one can remember how they set it up! :)