Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set up custom error pages (403, 404, etc) on an Apache 2.2 setup. I know that on IIS7.5 the pages are stored in


but am not sure where they are (or even if they exist) on Apache. Is there a .config file I need to change or something similar?

share|improve this question
Also, I've posted it on SF rather than webmasters.stackexchange as there's 4k+ questions tagged on SF for "apache" – tombull89 Feb 1 '11 at 12:33
up vote 3 down vote accepted

Usually such information is defined in your .htaccess. Eg:

ErrorDocument 500
ErrorDocument 404 /cgi-bin/
ErrorDocument 401 /subscription_info.html
ErrorDocument 403 "Sorry can't allow you access today" 

More information:

share|improve this answer
is this not for a per-site basis though? or is there a "master" .htaccess for all sites on that Apache install? – tombull89 Feb 1 '11 at 12:49
On Apache, the .htaccess files provide overrides to the standard configuration - which is stored in httpd.conf - where that file is will depend on how your apache was compiled and options on the command line used to start it (have a look in the directory tree where you installed apache). The ErrorDocument must be within the current vhosts document tree - so it makes sense to either define this within the vhost config or via a .htaccess file. – symcbean Feb 1 '11 at 13:55

This is normally just within the default DocumenRoot for the server. While this may be a bad example, cPanel stores it's default 404's in /usr/local/apache/htdocs/

Stock configurations will also load them from wherever the default document root is for all of the other non-matching requests.

share|improve this answer

Your Answer


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.