2
在我的IIS 7的配置,我已经创建友好的网址转换:IIS URL重写 - 友好的URL:查询字符串变量的值重复
http://mysite/restaurant.aspx?Name=SomeName
到
http://mysite/SomeName
要做到这一点,我有规则如下:
<rule name="RedirectUserFriendlyURL1" enabled="true" stopProcessing="true">
<match url="^Restaurant\.aspx$" />
<conditions>
<add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
<add input="{QUERY_STRING}" pattern="^Name=([^=&]+)$" />
</conditions>
<action type="Redirect" url="{C:1}" appendQueryString="false" />
</rule>
<rule name="RewriteUserFriendlyURL1" enabled="true" stopProcessing="false">
<match url="^([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" pattern=".aspx" negate="true" />
</conditions>
<action type="Rewrite" url="Restaurant.aspx?Name={R:1}" appendQueryString="false" />
</rule>
- 请问上面似乎正确的政绩我正在尝试什么?
出于某种原因,在每一个回传,我得到:
请注意,我已经设置appendQueryString为false。