2010-10-26 58 views
4

對於我的服務器上的每個請求重定向到一個安全的連接我用mod_rewrite的例外

RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://mywebsite.com/$1 [R,L] 

它可以完美運行。

但是我需要兩條路徑不被重定向。

說,當我訪問

http://www.mywebsite.com/page1/test 
http://www.mywebsite.com/page2 

我想去正是路徑。這可能與mod_rewrite?

回答

8

嘗試這樣:

RewriteCond %{SERVER_PORT} 80 
RewriteCond %{REQUEST_URI} !/page1/test 
RewriteCond %{REQUEST_URI} !/page2 
RewriteRule ^(.*)$ https://mywebsite.com/$1 [R,L]