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 879697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:58:31+00:00 2026-05-15T11:58:31+00:00

I have implemented custom errors in my asp.net mvc application by following this article

  • 0

I have implemented custom errors in my asp.net mvc application by following this article. What I have noticed is that if I go to http://www.mysite.com/some-non-existent-controller-and-action I get my 404 error page as expected. However, looking at what happens with firebug, I see that I get a 302 Found response for the non-existent page, which then redirects to my custom error page which then returns with a 404 (and displays the custom error page). Is this right? I don’t think the 302 that is first returned is very good especially from an SEO perspective, and that maybe I need to think again about how I have implemented this.

  • 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-05-15T11:58:32+00:00Added an answer on May 15, 2026 at 11:58 am

    The best guide(i think) for handling 404s can be found in this answer. Basically there are multiple ways in which 404s can happen:

    1. No route exists – matched by the catch all rule.
    2. Matched route but not found a controller – for rules with dynamic controller names – {controller}/{action}/{parameter} rule.
    3. Found route, but didn’t find action – handled through HandleUnknownAction override.
    4. Found route and action but couldn’t convert parameters – matched by the catch all rule.

    The linked answer basically sets up a controller that can be executed from any point in the code without rewriting the URL – which is what you want.

    In addition, you should also think about handling unhandled exceptions and bad URLs (like the ones containing unsafe characters like angle brackets). I that particular case you have to rewrite the URL, otherwise you can’t render the response at all. These particular requests are kind of tricky, i blogged about that here.

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

Sidebar

Related Questions

I'm developing an Asp.net (MVC but this doesn't really matter) application. I have a
I have a custom class that implements that IComparable. This class is stored in
I have a custom class that implements ICollection , and this class is readonly,
I need some help implementing a custom role provider in a asp.net mvc app.
I have a custom component where I have implemented INotifyPropertyChanged and IBindableComponent . However,
I have a simple C++ DLL that implements a few custom actions for a
I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs).
I have a custom object that implements INotifyPropertyChanged. I have a collection of these
I have a custom control that inherits from WebControl and implements IValidator, but I
I have this question: Does implementing a custom MembershipProvider class needs you to implement

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.