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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:50:54+00:00 2026-05-18T06:50:54+00:00

I have an HTTPModule running in IIS 7 providing a number of different URL

  • 0

I have an HTTPModule running in IIS 7 providing a number of different URL rewrite services.

For example:

public void Init(HttpApplication context)
{
    ...
    HttpContext.Current.RewritePath(landingPage.NewPath,
                                string.Empty,
                                landingPage.NewQueryString +
                                ((landingPage.NewQueryString == string.Empty) ? "" : "&") +
                                queryString);
    ...
}

I have a sub application with its own app pool written in MVC: http://www.SomeSiteWithURLrewrite.com/SubMVCApplication/

This module works great except for with MVC applications created as sub applications.

When I make an http request that will be rewritten: http://www.SomeSiteWithURLrewrite.com/Arbitrary/Path/To/Be/Rewritten

I receive a HTTP Error 404.0 – Not Found

The 404 error page shows that there was a call to “http://www.SomeSiteWithURLrewrite.com/Arbitrary/Path/To/Be/Rewritten” that had been rewritten to the physical path “C:{RootDirectory}\SubMVCApplication\” with the handler of “StaticFile”.

I am not sure why the pipline is not recognizing the “HttpContext.Current.RewritePath” as an MVC request. Is it because the MVC app is in its own application?

How can I call RewritePath (or something similar) and have IIS render an ASP.Net MVC page.in a sub application

  • 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-18T06:50:55+00:00Added an answer on May 18, 2026 at 6:50 am

    If you cross the application boundaries you will need to do a Response.Redirect which issues a client based HTTP 301 redirect command

    ReWritePath is a server only command, and needs access to the routing tables etc. Thus only the current application boundary

    There is no easy answer, other than making a page proxy in each web application to pass through content, but this would be highly inefficient

    e.g. server.com/a/x rewritten to server.com/b/x, you code would have to detect the application boundary changem, and would instead on a redirect would issue an HTTPRequest to get the server.com/b/x content and pass that content back to client? Resource paths etc would become a big issue so probably not a good idea

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

Sidebar

Related Questions

I have the following module public class LowerCaseRequest : IHttpModule { public void Init(HttpApplication
I have an HttpModule that I created and am running on IIS 6 using
Do I have to lock access to instance members? Example: public class HttpModule :
I have a custom HttpModule rewrite engine in an existing web application project that
I have an HttpModule, something like this: public class MyModule : IHttpModule { public
We are running a webforms project at my company and I have an HttpModule
I have a simple web site (localhost/test) in IIS 5.1 with only a HttpModule
I have an internet exposed WCF service running on IIS 7.5 that I need
I am running Win 7, IIS 7.0, VS2012 I have created asp.mvc4 web app
I have an ASP.NET 4 HttpModule (see code below). When the url path starts

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.