P Goupil
P Goupil

Reputation: 13

Renaming a URL in ASP.NET

I've been doing a lot of internet searches and searches on this site as well. I've recently taken a web dev job and I got a customer request to change a URL from it's current 'www.web.com/ax/abx/abcx/mysite' to 'www.web.com/mysite'. The /ax/abx/abcx/ is the nesting of office hiearchies in the solution, and there is a ton of them.

I've tried to lift the structure from the folder 'site' and create a virtual directory directly under the root site in IIS, but ran into a snake pit of template and .dll errors as the previous programmer nested those as well. I've already determined that it will take alot of time to rewrite the templates and .dlls to match the new namespace, and I'd rather not have to rewrite the website.

Is there a way to just 'spoof' the new URL so that the server knows where to go in the current directory structure if the user types 'www.website.com/site'?

Upvotes: 1

Views: 1326

Answers (4)

ajc123
ajc123

Reputation: 11

I highly recommend ISAPI_Rewrite for URL rewriting in IIS6: http://www.helicontech.com/isapi_rewrite/

It's free for one global configuration, or if you have multiple sites in your IIS, it's pretty reasonably for the upgrade that can handle that ($99).

I can help with specific usage if you pursue it.

Upvotes: 0

stephbu
stephbu

Reputation: 5082

Could also use URL rewriting - MSDN article below describes how...

http://msdn.microsoft.com/en-us/library/ms972974.aspx

There are also some nice standard packagings of RewriteURL - in neat configurable/installable modules - one example below is MSFT supported:

http://www.iis.net/download/URLRewrite

As with any approach that remaps a WebApp into a new "path", there are lots of side effects of doing rewriting, and gotchas/assumption such as hardcoded paths - I'd highly recommend testing the solution thoroughly.

Upvotes: 0

Malevolence
Malevolence

Reputation: 1857

If it's using asp.net 3.5 or higher, you can use web forms routing.

http://msdn.microsoft.com/en-us/library/cc668202(v=vs.90).aspx

Upvotes: 0

Related Questions