Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8104939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:01:38+00:00 2026-06-06T00:01:38+00:00

I am using the web.config code below to redirect requests to missing pages to

  • 0

I am using the web.config code below to redirect requests to missing pages to a 404 error handling page:

<customErrors mode="On" defaultRedirect="404.aspx" redirectMode="ResponseRewrite">
  <error statusCode="404" redirect="404.aspx"/>
</customErrors>

It works fine when I look for pages such as “missing.aspx” but it does not work for pages without the “.aspx” extension such as “missing.asp” or just “missing”. When it does not work, it just loads a standard IIS 7.5 error page.

What am I doing wrong? I am using .net 4. I noticed other people asking the same question but they didn’t get an answer.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:01:43+00:00Added an answer on June 6, 2026 at 12:01 am

    As dbaseman states this is because the asp.net handlers are not called for non-asp.net files. An easy way to force the asp.net handler to operate on all requests is to set the following in your web.config.

    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
    </system.webServer>
    

    This tells IIS to run through all of the managed modules for all requests such as .html, .jpg, .css, .js, etc. This is typically frowned upon as it just introduces extra processing and latency.

    http://www.hanselman.com/blog/BackToBasicsDynamicImageGenerationASPNETControllersRoutingIHttpHandlersAndRunAllManagedModulesForAllRequests.aspx

    Another option to try (cleaner than the above) was posted as an answer here: https://stackoverflow.com/a/6661699/701062

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following setting for customErrors in my web.config. <customErrors mode="On" defaultRedirect="GenericErrorPage.aspx" >
I'm using impersonate tag in my web.config in Asp.net 4.0 website. Below is my
So I am using connection strings in my web.config using SQL authentication. Of course
In our web.config I am using the following tag to determine the interface language
I've got 3 connectionstrings in web.config, and I used theirs like this: using (SqlConnection
We have a lot of web applications, configured using custom sections (in their web.config
I am using IIS V5.1. Integrated windows authentication I have a following web config:
I have an C# asp.net app using the default Sql MembershipProvider. My web.config has
I am trying to make authorize by using web.config. In my user registration, it
I don't really like the idea of defining user required pages in the web.config,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.