customerrors

ASP.NET/IIS: 404 for all file types

I set up 404 handler page in web.config, but it works ONLY when extension of URL is .aspx (or other which is handled by ASP.NET). I know I can setup static HTML page in website options, but I want to have a page. Is there any options to assign ASPX handler page for all request extensions in IIS? ...

overwriting a web.config root file to enable customerrors tag

I have a situation where I want to catch 404 errors fired by HTML pages (not just aspx pages) but I only have access to the web.config of the root folder of my website, and all sub directories (note, i don't have access to the actual IIS server and I cannot create applications or change settings) So I did try the web.config customerrors...

CustomErrors does not work when setting redirectMode="ResponseRewrite"

In a old site, I was changing the way that CustomErrors works by adding redirectMode="ResponseRewrite" (new in 3.5 SP1) The thing is that it shows me the generic error page (the one that you get when you don't set customErrors <customErrors mode="RemoteOnly" defaultRedirect="Error.aspx" redirectMode="ResponseRewrite"> <error status...

ASP.NET CustomErrors - RemoteOnly where "remote" means outside of our network

Does anybody have any clever solutions that they've used to turn on customErrors for everybody except for "us", where us = everybody on our network, IP range, etc. Therefore, outside world: friendly error page. Us: nasty yellow screen. ...

defaultRedirect page contents are not displayed

An ASP.Net 2.0 project uses Impersonation. If Web.config's username/password are not configured or are expired, I'd like to display a generic error page (even for local users). <authentication mode="Windows" /> <identity impersonate="true" userName="username" password="password"/> <customErrors mode="On" defaultRedirect="myErrorPage.htm...

Best way to pass last error to custom error redirect?

Was wondering what you thought of this solution, if this is right way to pass an error message to a custom page? In web.config: <customErrors mode="On" defaultRedirect="~/Error.aspx"></customErrors> In Global.asax: <script RunAt="server"> void Application_Error(object sender, EventArgs e) { Exception ex = Server.GetLast...

Error tag in Web.config customerErrors section needs an Int32 statusCode?

I keep coming across web examples of setting up custom error pages, and people do things like this: <customErrors mode="RemoteOnly" defaultRedirect="GeneralError.aspx"> <error statusCode="401.2" redirect="4012Error.htm"/> </customErrors> I know that a 401.2 redirect has its own set of headaches, but IIS isn't complaining about tha...

ASP.NET MVC Error Handling - View never renders, Web.config problem?

I have a [HandleError] attribute specified atop one of my controllers, specifying a View that I'd like to render in the event of an error. I also have the following config section in my web.config: <customErrors mode="On"> <error statusCode="404" redirect="~/Error/NotFound"/> <error statusCode="500" redirect="~/Error/Unknow...

Runtime-Error on productive Server but not locally

Hi there, so i finished one of my ASP.NET-projects and want to deploy it on the productive server. And suddenly WHOOM: Runtime error! Okay, no problem; look at the error message, see the stack trace, solve problem, everybody happy. Peanuts! The server tells me, that the customErrors-Settings in my web.config are set that no error mess...

Custom 404 page for ASP.net site on IIS7 for non-asp.net URL

I have asp.net site with custom 404.htm. It is configured with customErrors section to handle aspx. <customErrors mode="On" defaultRedirect="404.htm"> <error statusCode="403" redirect="404.htm" /> <error statusCode="404" redirect="404.htm" /> </customErrors> <system.webServer> <...

CustomErrors only catches explicit page links

I have custom errors turned on and when I go to www.mywebsite.com/video/default.aspx it shows error which corresponds to 404 and this is fine but when I go to www.mywebsite.com/video/ it shows a generic iis 404 error. My other pages that have files work fine like www.mywebsite.com/photo/ would redirect to www.mywebsite.com/photo/de...

customerrors for 401.2 in ASP.NET

I successfully implemented role based authorization in ASP.NET. When a person does not have the needed role he gets to see an error page for 401.2 not authorized. What I would like to accomplish now is to have a custom 401 page in my application and have it redirected there via settings in the web.config. I tried this: <customErrors m...

Custom error pages shown using IIS6 rather than web.config settings

Hi, this is my first post on this great source of programming information. I have developed new site for client and just doing some finishing touches. I am trying to create custom error pages which would be read from web.config <system.web> <customErrors mode="RemoteOnly"> <error statusCode="404" redirect="404.aspx" />...

Implementing a Custom Error page on an ASP.Net website.

I have an ASP.Net website and I want to use a custom error page. I put the following code in my web.config <customErrors mode="On" defaultRedirect="~/error.aspx"> <error statusCode="404" redirect="~/error.aspx" /> </customErrors> The problem is when i go to a URL that does not exist is still uses the 404 error page specified in II...

Determine if .NET sent me to custom error page?

web.config: <customErrors mode="On" defaultRedirect="~/Foo.aspx" /> When Foo.aspx.cs is running, how can I know that an uncaught exception is what sent me to Foo.aspx? ...

iis 6 custom error not working in ie

I've set up the custom errors in webconfig and it's working great for .aspx pages. But, I'm trying to handle the .htm or .html or .pdf errors (mainly not found). Understand from research that handling in extensions to the .dll is not good for performance (this true even if you don't have hardly any .htm pages?) So, I went into IIS and...

Does processModel/serverErrorMessageFile work when accidentally mixing ASP.NET versions in IIS6?

I've tried setting serverErrorMessageFile to a path relative to machine.config, and to an absolute path, but when accessing an app on our IIS6 server that shares a pool with another ASP.NET version, we still get the big, ugly, red, default Server Application Unavailable message. Since one of our ASP.NET apps recently (and mysteriously) ...

Changing customErrors in web.config semi-dynamically

The basic idea is we have a test enviroment which mimics Production so customErrors="RemoteOnly". We just built a test harness that runs against the Test enviroment and detects breaks. We would like it to be able to pull back the detailed error. But we don't want to turn customErrors="On" because then it doesn't mimic Production. I'v...

asp mvc custom HTTP 401 page

I'm trying to get a custom HTTP 401 error working on asp mvc 2 on the development server with no luck. In my root web.config i have <authentication mode="Windows"> </authentication> and <customErrors mode="On"> <error statusCode="401" redirect="/Home/NotAuthorized"/> </customErrors> and i've defined the Action on the Home co...

web.config custom 404 error not working in IIS5

Hi, I've made a custom 404 error page in my codebase and have the following lines in the web.config to direct the customer to this page in the event of a 404. <httpErrors errorMode="Custom"> <remove statusCode="404" subStatusCode="-1"/> <error statusCode="404" prefixLanguageFilePath="" path="pgeNotFound.html" responseMode="File"/> ...