【问题标题】:http to https EXCEPThttp 到 https 除外
【发布时间】:2018-07-10 21:36:10
【问题描述】:

我正在使用它将所有对 http 页面的请求重定向到 https。但是,我需要排除网站上必须保持 http 的某些页面。我不知道该怎么做。 重写引擎开启 RewriteCond %{SERVER_PORT} 80 重写规则 ^(.*)$ https://www.reny.net/$1 [R,L]

【问题讨论】:

    标签: url mod-rewrite https


    【解决方案1】:

    使用RewriteCond 在RewriteRule 之前检查%{REQUEST_URI}

    RewriteEngine On 
    RewriteCond %{SERVER_PORT} 80 
    RewriteCond %{REQUEST_URI} !^(/page1|/page2)$
    RewriteRule ^(.*)$ https://www.reny.net/$1 [R,L]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-10
      • 1970-01-01
      • 2012-04-02
      • 1970-01-01
      • 2011-07-21
      • 1970-01-01
      • 2014-07-22
      • 1970-01-01
      相关资源
      最近更新 更多