Page 1 of 1
Trapping 500 error
Posted: Wed Mar 05, 2008 2:21 pm
by Will
Right now if someone tries to go to a file with .asp extension, the site is throwing a generic "HTTP/1.1 500 Server Error".
I've set up the following in the web.config file:
Code: Select all
<customErrors mode="On" defaultRedirect="~/errors/general.aspx">
<error statusCode="404" redirect="~/errors/404.aspx" />
</customErrors>
I also went to my hosting company's control panel and set the error code of 500 to direct to /errors/general.aspx. Still getting just a generic "HTTP/1.1 500 Server Error".
This only happens when I enter a url ending with a file extension of ".asp".
How do I go about trapping this an redirecting people to our general error page?
Thanks.
Posted: Wed Mar 05, 2008 7:16 pm
by AbleMods
Maybe I'm missing something, but you said you're getting a "500" error but your custom-error mapping is for a Page 404 error.
Aren't those trapped separately in IIS?
Posted: Wed Mar 05, 2008 8:49 pm
by Will
I figured the defaultRedirect="~/errors/general.aspx" would deal with everything else besides the 404.
I figured the 500 error might be deeper down, so I also used my hosting provider's "Helm" control panel to designate a page to show when a 500 error is returned.
I should probably talk to my hosting provider.
Posted: Wed Mar 05, 2008 9:00 pm
by AbleMods
What happens if you just turn CustomErrors="Off" in your site web.config?
Same thing?
Posted: Wed Mar 05, 2008 9:05 pm
by AbleMods
Wow my site blows up the entire theme if I hit a subfolder with an invalid .asp URL.
Basic content appears, but no theme data whatsoever. Too weird.
Will, it sounds like the ISP has some non-defaults for custom errors set in your site configuration. My web.config has custom errors off and I can hit any .asp fake URL in my root and it auto-loads the default.aspx.
I didn't configure anything on my IIS site configuration other than making default.aspx the default document.
Posted: Thu Mar 06, 2008 7:53 am
by Will
Yeah, no matter what I get the 500 error. Custom errors on or off.
Posted: Thu Mar 06, 2008 7:57 am
by AbleMods
Very odd behavior indeed.
If I hit my site with:
http : // www solunar com / fakepage.asp
I will auto-redirect to default.aspx and it is seamless to the user.
But if it hit my site with:
http: // www solunar com / assets / fakepage.asp
The whole theme blows up yet some content still downloads. No HTTP errors at all, just a really ugly page.
I will ticket my scenario because I don't think behavior is expected.
Posted: Thu Mar 06, 2008 8:13 am
by Will
If I have custom errors off, for the 404 error, I get a generic ASP.net error:
Code: Select all
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /fakepage.aspx
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
The only way for me to get the 404 page I've set is to have custom errors on and have them point to the 404 page. Either way I still get the ugly 500 error.
Posted: Thu Mar 06, 2008 8:50 am
by AbleMods
Interesting - definitely different than how mine is working.
If you're ISP wants to compare site settings with me, just have them give me a call - my contact number is on my Contact Us page on Solunar.com.
Posted: Thu Mar 06, 2008 8:53 am
by Will
Thanks Joe. You rock.
Posted: Thu Mar 06, 2008 10:07 am
by Will
Got it resolved. The host had to change some setting on the server that I couldn't access.
Posted: Thu Mar 06, 2008 10:09 am
by AbleMods
Awesome!
