url rewrite for aspx page

浪子不回头ぞ 提交于 2019-12-23 04:15:17

问题


I have a page, called foo.aspx and i d like to rewrite the url as bar.something

How to do this? How does url rewrite happens in asp.net

Should i create a generic handler?

or should i get some url rewrite modules and add to app?


回答1:


This is done by configuring IIS, and will require IIS7, look here for configuration help: http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/




回答2:


Remember, you also have the new Routing option with ASP.NET 4.0:

https://stackoverflow.com/questions/90112/iis-url-rewriting-vs-url-routing

You should also check this SO response:

IIS URL Rewriting vs URL Routing

Some basic info on the differences between URL Re-Writing and Routing:

http://learn.iis.net/page.aspx/496/iis-url-rewriting-and-aspnet-routing/



来源:https://stackoverflow.com/questions/2789312/url-rewrite-for-aspx-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!