2014-02-18 82 views
0

我在IIS 7.5中安裝了URL重寫模塊,並做了一個簡單的入站規則的URL完全匹配,然後我重定向用戶..但是當我去的URL它根本不會重定向我它只是加載page..I還檢查Web配置和我得到這個錯誤的元素systsem.webserver已經無效智利元素改寫..here的web.config中的XML,我有URL重寫根本不起作用

<system.webServer> 
     <httpErrors> 
      <remove statusCode="404" subStatusCode="-1" /> 
      <error statusCode="404" prefixLanguageFilePath="" path="/default.aspx" responseMode="ExecuteURL" /> 
     </httpErrors> 
     <rewrite> 
      <rules> 
       <rule name="redirect" patternSyntax="ExactMatch" stopProcessing="true"> 
        <match url="http://localhost:8989/pay.htm" negate="false" /> 
        <action type="Redirect" url="http://localhost:8989" appendQueryString="false" redirectType="Temporary" /> 
       </rule> 
      </rules> 
     </rewrite> 
    </system.webServer> 

我做這裏有什麼錯誤,或者我配置了模塊錯誤..我試圖重新安裝和repiar,但沒有運氣。

回答

1

IIS重寫不與本地主機

工作不管怎樣,你的規則應該是這樣的

<rule name="redirect" stopProcessing="true"> 
    <match url="^/?pay\.htm$" /> 
    <action type="Redirect" url="http://www.domain.com" appendQueryString="false" redirectType="Temporary" /> 
</rule> 
+0

這也並非只是working.It加載原始頁面,並且不重定向。 – user505210

+0

你用'http:// localhost:8989/pay.htm'來試試嗎?你有沒有用我的規則代碼試試*它? –

+0

是的,我嘗試使用http:// localhost:8989/pay.htm ..並且我使用你的代碼更新了web.config。 – user505210