views:

65

answers:

1

I'm in the process of moving a large classic ASP application to ASP.NET MVC 2. Questions:

My question is about project organization.

I would prefer to not mix the MVC code with the ASP code in the same VS project. I'd like to have an MVC WAP with areas that match the parts of the website that I'm migrating. For instance, the old site has a folder

/products/default.asp.....

/products/productName/default.asp

etc.

In the MVC WAP, I'd like to have an area called "products", which I could then, either through a rewrite, routing, or preferably through some IIS configuration, point the "products" folder on the ASP site to. In this way, I could gradually move root folders from the ASP site to the MVC application.

However, if I create the MVC WAP in a virtual folder, then my routes wind up looking like

http://localhost/virtualFolder/products

instead of

http://localhost/products

Any suggestions on how to conquer this?

I know that, during deployment, I could deploy the MVC WAP into the root of the ASP site, but this doesn't help with debugging.

+1  A: 

I'll write my answer assuming this is hosted on an IIS7 instance. If it's IIS6, then you'll need to look for a suitable ModRewrite module for it.

So, assuming IIS7, you'll be far better off using URL Rewrite: http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/

You can manage your rewrite rules and rewrite maps, depending on your level of access and control, either from within the IIS7 Administration Console, or manually via your web.config file.

These rewrite rules and maps can be as simple or complex as you need them to be. You can also set them up to be either a temporary or permanent redirect - which will assist if any search engines are indexing the site as the correct redirect code will be returned with the HTTP request to ensure crawler results are updated promptly.

thewinchester