为了将服务器上的每个请求重定向到安全连接,我使用
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://mywebsite.com/$1 [R,L]
完美的作品。
但是我需要两个路径不被重定向。
当我访问时说
http://www.mywebsite.com/page1/test
http://www.mywebsite.com/page2
我想走那条路。使用mod_rewrite可以吗?
最佳答案
尝试这样的事情:
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} !/page1/test
RewriteCond %{REQUEST_URI} !/page2
RewriteRule ^(.*)$ https://mywebsite.com/$1 [R,L]
关于apache - 带有异常的mod_rewrite,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4021722/