Solved

IIS does not respond to <error statusCode="404" redirect="~/Errors/Error404.aspx" />.  Other errors do. Why?

Posted on 2004-03-22
2
988 Views
Last Modified: 2012-05-04
The system.web part of my web.config file has the following :

            <customErrors defaultRedirect="~/Errors/GeneralError.html" mode="On">
                  <error statusCode="404" redirect="~/Errors/Error404.aspx" />
                  <error statusCode="403" redirect="~/Errors/Error403.aspx" />
            </customErrors>

The error 403 page is correctly called when I try to access, for example the web.config file with the browser. However, I cannot get the dyamic 404 page to be called - the IIS default is called instead.

Can anyone explain what on earth is going wrong? It looks so simple in principle!

In my application, the 404 custom error must be configured from the web.config file. A direct change to the IIS would otherwise do the job, but this is not an option.

Thanks.
0
Comment
Question by:Daeljan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
Daeljan earned 0 total points
ID: 10655982
Ok, the answer to this question is that unless the requested URL ends in ".aspx", the 404 error will not be handled by the application. When it ends in ".aspx", IIS calls the designated page with the URL argument "aspxerrorpath=<filename>.aspx".

If you want to avoid this ugly URL, or extend the error handling beyond aspx pages, then you have to speak nicely with your site hosting company and ask them to change the configuration of IIS to call a particular URL when error 404 is generated.

Personally, I think the dynamic 404 error handling could have been better implemented.

A little more information may be found at: http://www.aspwarp.com/customerrors.aspx

As I have answered my own question, I'd like to close this now and have my points refunded.

Thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Logparser is the smartest tool I have ever used in parsing IIS log files and there are many interesting things I wanted to share with everyone one of the  real-world  scenario from my current project. Let's get started with  scenario - How do w…
What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question