【问题标题】:mod_rewrite with exceptionsmod_rewrite 有例外
【发布时间】:2010-10-26 08:02:02
【问题描述】:

为了将我服务器上的每个请求重定向到我使用的安全连接

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

效果很好。

但是我需要两条不被重定向的路径。

当我访问时说

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

我想走那条路。 mod_rewrite 有可能吗?

【问题讨论】:

    标签: apache mod-rewrite


    【解决方案1】:

    试试这样的:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-13
      • 2012-10-12
      • 2016-02-06
      • 1970-01-01
      相关资源
      最近更新 更多