开发者

Postcode url rewrite using IIS7 URL Rewrite not working

开发者 https://www.devze.com 2023-02-12 08:42 出处:网络
I have just started using IIS7 and am setting up various URL rewrites. I am new to this so I may be making a novice mistake.

I have just started using IIS7 and am setting up various URL rewrites. 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

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?


Had to remove the leading slash and it worked.

0

精彩评论

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