For my personal website, I wanted to make a webpage for every error that could come up on an Apache web server - so that it could fit in better with the style of the website instead of the generic Apache messages. As far as I know, the only way to do that would be to create individual webpages for all 50-some error codes, and individual ErrorDocument entries for each one of those. Is there a way to handle them dynamically (I.e. redirect all errors to a webpage with the error code as a GET/POST value)?
The best way is to create one
ErrorDocument per page, but redirect all errors to the same page. This gives you the dynamic part that you want while you still can change easily that configuration at any time reassigning a new
ErrorDocument for specific cases.
Then on that page, you can configure different processes or responses, depending on the
For the specific situation of the 500 errors, consider that those are server errors, so even when you have an
ErrorDocument configured for that situation, it may not be possible to use it, so in some cases just the default message will be presented to the user.