简体   繁体   English

ASP.NET + IIS 7-URL重写

[英]ASP.NET + IIS 7 - URL Rewriting

I have an index site. 我有一个索引站点。 On every index there are sub-categories and different cities. 每个索引上都有子类别和不同的城市。 Today my URLs look like this: ~/index.aspx?indexid=1&catid=2&location=4 今天,我的网址看起来像这样:〜/ index.aspx?indexid = 1&catid = 2&location = 4

I want to rewrite this to: ~/party-planning-birthday-parties-new-york Where indexid=1 is an index named Party Planning, catid=2 is a sub-category called "birthday parties" etc. 我想将其重写为:〜/ party-planning-birthday-parties-new-york其中indexid = 1是一个名为Party Planning的索引,catid = 2是一个名为“生日派对”的子类别,等等。

What would be the best way of going about this? 最好的方法是什么? And a small side question: Do you think this is a good rewriting scheme? 还有一个小问题:您认为这是一个好的重写方案吗? I think it makes the URLs much more readable and informative. 我认为这使URL更具可读性和信息量。

Thank you! 谢谢! -Elad -埃德

It seems there is an official solution on the official IIS developer community page: 官方IIS开发人员社区页面上似乎有一个官方解决方案:

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

Never used it myself - I've only used their older sample code (which worked well enough for my purposes). 我自己从未使用过它-我只使用了他们的较早的示例代码(对于我的目的来说效果很好)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM