1

I have an Apache server serving numerous domains as virtual hosts. I'd like to override Apache's default error pages (404, 500, etc) to apply to all of these virtual hosts, while still giving each host the ability to customize their own to replace the default. Is there any way to do this short of copying a standard set of documents to each virtual host's ErrorDocument locations?

I thought to use a symlink, but this would not allow each virtual host to customize their own while having a common fallback.

Edit: To be clear, I want to have a set of error documents which override Apache's default error handler documents, which are kept outside of the virtual host directories (so that virtual hosts do not need to even know about them) and still allow each virtual host to have their own error documents if they so choose.

smdrager
  • 131
  • 7

2 Answers2

1

The ErrorDocument directive is inherited in virtual hosts. So set your ErrorDocument directives globally (outside any VirtualHost container) and let them override it if they like.

quadruplebucky
  • 5,041
  • 18
  • 23
  • But the page I use to override apache's default error page across all the virtual hosts would still have to be in each virtual host's directory correct? – smdrager Feb 20 '14 at 11:06
0

Check your AllowOverride setting in httpd.conf. This should allow each site's config to override the default error page setting

Babatunde
  • 11
  • 1
  • This somewhat works, however it would still require a copy of my standard error documents to be within each virtual host's directory. I'd prefer to have the default error documents somewhere out of sight (similar to how the standard Apache error pages are). – smdrager Feb 20 '14 at 11:10