使用urlrewrite在iis7中进行网址重写 [英] Url Rewriting in iis7 using urlrewrite
问题描述
我正在从事一个项目,并且已成功实施了URL重写的规则,以使URL显示为
http://www.domainname.com/shop/shopname
我一直想让它像
http://www.doaminname.com/shopname
我可以根据页面名称来渲染商店页面.表示我不希望在/shop/之间.我尝试了许多规则,但没有运气.我希望在此提供任何帮助
谢谢.
I am working on a project and have implemented successful rule for the url rewriting for the url to be displayed as
http://www.domainname.com/shop/shopname
and I was trying to have this like
http://www.doaminname.com/shopname
and I can render the shop page according to its page name. Means I do not want /shop/ in between. Many rules I had tried but no luck. I would appreciate any help in this
Thanks.
推荐答案
我认为类似的方法可以做到
I think something like this will do it
<rewrite>
<rules>
<rule name="Rewrite to article.aspx">
<match url="^/([_0-9a-z-]+)" />
<action type="Rewrite" url="yourshoppage.aspx?shopname={R:1}" />
</rule>
</rules>
</rewrite>
请检查您是否还有其他规则,因为顺序可能会影响到该规则.还要检查您的正则表达式等.
希望对您有帮助
please check if you have other rules because the order might be affecting that. Also check your regex etc.
hope it helps
这篇关于使用urlrewrite在iis7中进行网址重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!