简体   繁体   English

使用IIS7 URL重写的邮政编码URL重写不起作用

[英]Postcode url rewrite using IIS7 URL Rewrite not working

I have just started using IIS7 and am setting up various URL rewrites. 我刚刚开始使用IIS7,并且正在设置各种URL重写。 I am new to this so I may be making a novice mistake. 我是新手,所以我可能会犯一个新手错误。

I am trying to rewrite a postcode so that I can have /KA71DR rewrite to /gis/property.asp?postcode=KA71DR 我正在尝试重写邮政编码,以便可以将/ KA71DR重写为/gis/property.asp?postcode=KA71DR

I have the following but it's not working: 我有以下内容,但无法正常工作:

<rule name="Postcode">
<match url="^/[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$" />
<action type="Rewrite" url="/gis/Property.aspx?postcode={R:0}" />
</rule>

The Test Pattern works. 测试模式有效。 But when I try the page it returns a 404. Can anyone suggest what I am doing wrong? 但是,当我尝试该页面时,它返回404。有人可以建议我做错了吗?

不得不删除领先的斜杠,它的工作。

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

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