2010-10-26 100 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]