开发者

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.

No开发者_运维问答w, 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?


Have you tried IIS URL Rewrite?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜