2015-07-03 54 views
2

我已經擁有301從HTTPSHTTP到站點範圍。 但我想排除結賬網頁,使他們總是HTTPS(位於「/購物推車/」)如何從HTTPS排除單個目錄到HTTP 301使用IIS6 + IIRF重定向

試過這樣:

#RewriteCond %{SERVER_PORT} ^443$ 
#RewriteRule ^(.*)$ http://www.example.com$1 [R=301] 

#RewriteCond %{SERVER_PORT} ^80$ 
#RewriteCond %{HTTP_HOST} ^www.example.com$ 
#RedirectRule ^/shopping-cart(.*)$ https://%{HTTP_HOST}/shopping-cart$1 [R=301] 

這給了我一個重定向循環,當我到達/shopping-cart/

回答

0

我認爲導致循環是規則的序列。交換他們和[l]標籤添加到shopping_cart規則(該[l]指「最後」,即停止處理更多規則,如果該規則匹配)

#RewriteCond %{SERVER_PORT} ^80$ 
#RewriteCond %{HTTP_HOST} ^www.example.com$ 
#RedirectRule ^/shopping-cart(.*)$ https://%{HTTP_HOST}/shopping-cart$1 [R=301, l] 

#RewriteCond %{SERVER_PORT} ^443$ 
#RewriteRule ^(.*)$ http://www.example.com$1 [R=301]