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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:07:14+00:00 2026-06-07T06:07:14+00:00

We are currently using a custom error page for 404 errors for our Web

  • 0

We are currently using a custom error page for 404 errors for our Web App. When the redirect occurs aspxerrorpath contains the path the user was trying to access. Is it possible to catch the error in Application_Error within Global.asax and append a new parameter to the query string before the redirect occurs? I’d like to append the host the user was requesting.

My understanding is that IIS handles the 404 redirect and appending the aspxerrorpath param to the 404 redirect, I’d like to intercept this before it occurs and append another param to the querystring.

More Info: We have multiple sites within a CMS so the requested url will not always be www.example.com but the 404 redirect will always be to www.example.com.

Currently: user requests www.example.com/fakepage.aspx and is redirected to…

www.example.com/404.aspx?aspxerrorpath=/fakepage.aspx

What I want: user requests www.example.com/fakepage.aspx and is redirected to…

www.example.com/404.aspx?aspxerrorpath=/fakepage.aspx&aspxerrorhost=example.com

SOLUTION:
I ended up implementing a custom HttpModule (see the answer below). I just wanted to pass along an excellent article explaining how to do this. http://helephant.com/2009/02/11/improving-the-way-aspnet-handles-404-requests/

  • 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-07T06:07:15+00:00Added an answer on June 7, 2026 at 6:07 am

    In order to trap the error and append the querysting you will need to write you own HttpHandler by inheriting the IHttpHandler interface and add the custom code in ProcessRequest method

    Yes this will be for all request but can trap the one your after

    Please see link for how to do : MSDN

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

Sidebar

Related Questions

Using IIS 7.5 I have created a custom 404 (and 403.14) error page that
I have a mvc web site that contains one non-mvc page (it is using
I'm not seeing the real error in my custom error page when using an
I'm using a MOSS Publishing site with a custom master page. One of our
I am currently ordering a list of custom objects using the IQueryable OrderBy method
I want to add traffic information to my custom map. Currently I'm using a
I am using wordpress latest version. Currently my blog is set to custom permalink
Currently using Google Analytics as a supplement to our paid tracking software, but neither
We were previously using a non-search engine friendly custom CMS for our case record
I'm trying to convert a project that is currently using a custom DAO framework

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.