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.
views:
535answers:
5You 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.
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?
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
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).
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.