2010-07-08 131 views
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=([^=&amp;]+)$" /> 
    </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> 
  1. 请问上面似乎正确的政绩我正在尝试什么?
  2. 出于某种原因,在每一个回传,我得到:

    http://somesite/SomeName?Name=SomeName

请注意,我已经设置appendQueryString为false。

回答