DDiVita
DDiVita

Reputation: 4265

ASP.NET URL rewriting and redirecting

I am trying to wrap my head around a URL rewrtie / redirect project I need to work on. We currently have this url: http://www.example.com/Details/Detail.aspx?param1=8&param2=12345

Here is what the rewritten URL will look like: http://www.example.com/Param1/8/Param2/12345

I am using the ISAPI_Rewrite filter to allow for the "nice" url and make the page think it is still using the old url. That works fine.

Now, I need to redirect users, if they use the old URL, to the new URL. I figure I would need to use a combination of the filter and an HTTPModule / Handler to perform the redirect.

Any ideas?

Upvotes: 1

Views: 880

Answers (3)

abatishchev
abatishchev

Reputation: 100268

Have you tried IIS URL Rewrite?

Upvotes: 1

Danish Khan
Danish Khan

Reputation: 1891

Using a HttpHandler would be your best bet. That way, you will be able to track all incoming requests, filter out the old format URLs and redirect them to the correct pages.

Upvotes: 0

Kane
Kane

Reputation: 16802

If you are not going to go down the System.Web.Routing (or use ASP.NET MVC) path then I would have a look at this link.

Upvotes: 0

Related Questions