-1

let me start by prefixing my knowledge of apache is basically non existent and that I am trying work with something that was here before me.

My problem is that we are hosting an ASP.net MVC web site behind apache running on mono on docker. We have had some reports where we get Apache error pages when there are faults in the ASP.net application that prevents the app from rendering its own error page. I would like to be able to configure apache to redirect to an error page on a specify url but can't work out where in the config file this should be done or how to do it.

To complicate matters, I need to redirect to the top level domain specific error page depending on where the original request came from. i.e. 500 error on name.com/whatever goes to name.com/500.html, 500 error on name.jp/whatever goes to name.jp/500.html

Any hints would be appreciated

user22785
  • 189
  • 1
  • 1
  • 3

1 Answers1

0

So I finally worked it out with some help from a colleague.

There was already a Location configuration for "/" so we just needed to add ErrorDocument directives as shown below

<Location "/">
    Allow from all
    Order allow,deny
    MonoSetServerAlias dff
    SetHandler mono
    ErrorDocument 500 /feedback/content/error.html
    ErrorDocument 503 /feedback/content/error.html
  </Location>
user22785
  • 189
  • 1
  • 1
  • 3