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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:54:52+00:00 2026-05-11T05:54:52+00:00

I am using Context.RewritePath() in ASP.NET 3.5 application running on IIS7. I am doing

  • 0

I am using Context.RewritePath() in ASP.NET 3.5 application running on IIS7.

I am doing it in application BeginRequest event and everything works file.

Requests for /sports are correctly rewritten to default.aspx?id=1, and so on.

The problem is that in my IIS log I see GET requests for /Default.aspx?id=1 and not for /sports.

This kind of code worked perfectly under IIS6.

Using Microsoft Rewrite module is not an option, due to some business logic which has to be implemented.

Thanks.

EDIT:

It seems my handler is too early in the pipeline, but if I move the logic to a later event, than the whole rewrite thing doesn’t work (it’s too late, StaticFileHandler picks up my request).

I googled and googled, asked around, can’t believe that nobody has this problem?

EDIT:

Yikes! Here’s what I found on the IIS forum:

‘This is because in integrated mode, IIS and asp.net share a common pipeline and the RewritePath is now seen by IIS, while in IIS6, it was not even seen by IIS – you can workaround this by using classic mode which would behave like IIS6.’

Final update: Please take a look at my answer below, I’ve updated it with results after more than a year in production environment.

  • 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. 2026-05-11T05:54:52+00:00Added an answer on May 11, 2026 at 5:54 am

    After some research, I’ve finally found a solution to the problem.

    I have replaced the calls to Context.RewritePath() method with the new (introduced in ASP.NET 3.5) Context.Server.TransferRequest() method.

    It seems obvious now, but not event Senior Dev Engineer on IIS Core team thought of that.

    I’ve tested it for session, authentication, postback, querystring, … issues and found none.

    Tommorow I’ll deploy the change to a very hight traffic site, and we’ll soon know how it actually works. 🙂

    I’ll be back with the update.

    The update: the solution is still not entirely on my production servers but it’s tested and it does work and as far as I can tell so far, it’s a solution to my problem. If I discover anything else in production, I will post an update.

    The final update: I have this solution in production for over a year and it has proven to be a good and stable solution without any problems.

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

Sidebar

Related Questions

I've got some RESTful services running in a pure WCF context (i.e. ASP.NET compatibility
In C# i am doing context.Response.ContentType = image/png; context.RewritePath(sz); context.Response.ContentType = image/png; It seems
I'm about uploading file to remote server using fsockopen() without using context. I'm able
I'm a little confused on how binding to services works. I understand using Context.startService()
I'm trying to do this: using(var context = new SampleEntities()) { User user =
I want to display the infinity symbol using CGContextSelectFont(context, HelveticaNeue, textSize, kCGEncodingMacRoman); CGContextShowTextAtPoint(context, myCenter.x,
I have a listview with two columns and I'm using a context menu to
for example I'm trying to get the data from database like: using (ExplorerDataContext context
I've been trying to display text using a Quartz context, but no matter what
I cannot seem to access the context object using a loop context is set:

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.