I'm trying to configure a static html page as a custom 500 error page in our umbraco solution. To test I took my umbraco database offline (simulating a connection issue or something like that).
Using the custom errors section did not work, as it seems that umbraco is trying to do some sort of authroization checking on static html files...at which point it fails as the database is not available. I managed to serve the static html page by adding the following for the httpErrors section in our web.config:
This allows the static error-500.html file to be rendered, but I'm still unable to reference any other files in my installation (such as images and css) as they all throw 500 errors themselves (presumably due to this authorization).
Can I make umbraco serve specified paths without trying to do any authorization? So just serve them as simple static files.
what i think you need to do is add you html file path to your web.config in the key "umbracoReservedUrls", this tells umbraco that it should not take over that url :)
Unfortunately I just tried it and it hasn't worked - I get the same issue with the static html page request throwing an exception. Looks like the same exception too:
so now youre getting the page, but all other reqeust like css files is throwing the exeption ? maybe this is caused by umbracos standard 404 handler ? :)
With this code custom error will be shown for remote connected users and detailed error for connecting locally. Custom error static html is shown fine, but when connecting locally I see IIS error (HTTP Error 500.0 - Internal Server Error), not the ASP.NET one with exception details. The problem is that there is no usefull info like stack trace, etc. in IIS error which makes debuging practically impossible.
If you set existingResponse="PassThrough" even with errorMode="Custom" detailed error is shown and custom error page not.
Any ideas how to make custom error page working along with asp.net detailed error page for local connections?
I am thinkng of using errorMode="Auto" and setting Response.TrySkipIisCustomErrors=true; but don't know where to do that.
We're also having troubles with this. Can replicate it on a fresh install of 7.3.5 (add an error.htm page, config as above, change connection string to db).
Is there any way to hook into the startup process? I e check if the database is available and redirect to a custom page before Umbraco tries to connect to it.
Custom 500 Error Page
I'm trying to configure a static html page as a custom 500 error page in our umbraco solution. To test I took my umbraco database offline (simulating a connection issue or something like that).
Using the custom errors section did not work, as it seems that umbraco is trying to do some sort of authroization checking on static html files...at which point it fails as the database is not available. I managed to serve the static html page by adding the following for the httpErrors section in our web.config:
<httpErrors errorMode="Custom" existingResponse="Replace">
<remove statusCode="500" subStatusCode="-1"/>
<error statusCode="500" path="error-500.html" responseMode="File" />
</httpErrors>
This allows the static error-500.html file to be rendered, but I'm still unable to reference any other files in my installation (such as images and css) as they all throw 500 errors themselves (presumably due to this authorization).
Can I make umbraco serve specified paths without trying to do any authorization? So just serve them as simple static files.
Hello Matt
what i think you need to do is add you html file path to your web.config in the key "umbracoReservedUrls", this tells umbraco that it should not take over that url :)
Thanks for replying so fast.
Unfortunately I just tried it and it hasn't worked - I get the same issue with the static html page request throwing an exception. Looks like the same exception too:
hmm, that sounds like it's not ignoring the URL you can try and add the path to "umbracoReservedPaths"
also you could try and set the exit response on errors to PassThrough.
Yes, that is my exact configuration right now, looks like this:
httpErrors Section:
customErrors section
And appSettings umbracoReservedPaths part:
This is giving me the error stated above
Thank you so much for your help.
Okay, that is wierd..
you may have to add
(found it here http://kitsula.com/Article/MVC-Custom-Error-Pages it seems to be the MVC part thats making changes to id)
let me know if it helps :)
Afraid not, still getting the same error.
If I change it to:
It will return the error-500.html page, but it still throws the same exception for all other files (like css and images)
so now youre getting the page, but all other reqeust like css files is throwing the exeption ? maybe this is caused by umbracos standard 404 handler ? :)
Ok, I think I've found the problem! I've been using uSync and if I turn it off it seems to resolve the issue.
Obviously uSync tries to sync everything to the database as it loads up, which it cant so it errors.
Thanks for all your help
Hi guys,
great thread, managed to show static html based on your posts.
But now I have same problem as Matt's - exception is thrown for all resources (css, images, etc) included in static error page.
In my case it is uSitebuilder which also has autosync causing this. Some workaround as inlining css and similar can be implemented.
But there is another, more serious issue with error page:
With this code custom error will be shown for remote connected users and detailed error for connecting locally. Custom error static html is shown fine, but when connecting locally I see IIS error (HTTP Error 500.0 - Internal Server Error), not the ASP.NET one with exception details. The problem is that there is no usefull info like stack trace, etc. in IIS error which makes debuging practically impossible.
If you set existingResponse="PassThrough" even with errorMode="Custom" detailed error is shown and custom error page not.
Any ideas how to make custom error page working along with asp.net detailed error page for local connections?
I am thinkng of using errorMode="Auto" and setting Response.TrySkipIisCustomErrors=true; but don't know where to do that.
Hi,
We're also having troubles with this. Can replicate it on a fresh install of 7.3.5 (add an error.htm page, config as above, change connection string to db).
Is there any way to hook into the startup process? I e check if the database is available and redirect to a custom page before Umbraco tries to connect to it.
When you enable 500 custom error page it catches ALL ERRORS, including exceptions on web api.
To enable 500 error page and still have exception on webapi you must edit your web.config file like this
When you enable 500 custom error page it catches ALL ERRORS, including exceptions on web api.
To enable 500 error page and still have exception on webapi you must edit your web.config file like this
Here is useful post
http://adaodeveloper.blogspot.in/2015/09/umbraco-500-error-page.html
is working on a reply...