views:

535

answers:

5

I have to have my website stored in a subfolder of my domain root. Is there a way to rewrite the URLs so that it doesn't appear to be stored in a subfolder? It doesn't matter to me if this is done at the IIS level or in the web.config.

A: 

You can presumably get the behavior you want by using an ISAPI filter.

Google for: rewrite ISAPI filter and you will find some prebuilt examples to try and see what works best for you.

Klathzazt
+1  A: 

Have you looked at the routing engine that came out of the MVC project but is now a stand-alone feature of the .NET Framework?

sliderhouserules
+1  A: 

With IIS7, the way to go is probably the module that Microsoft themselves put out: http://blogs.iis.net/ruslany/archive/2008/11/10/url-rewrite-module-release-to-web.aspx

In previous releases, there were various workarounds with different downsides/costs: http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx

tlianza
Here is a tutorial on how to set it up. http://learn.iis.net/page.aspx/461/creating-rewrite-rules-for-the-url-rewrite-module/
notandy
+1  A: 

If you decide to go with an ISAPI filter, we've had good experiences with Ionic's Isapi Rewrite. And it's free (beer and speech).

Erik Hesselink
+1  A: 

I'm using the ManagedFusion Url Rewriter on my blog. I like it because it doesn't need to be installed at the server level.

Rob Boek