2010-07-08 141 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。

回答