【问题标题】:Force SSL except on the homepage index.php using .htccess使用 .htccess 在主页 index.php 上强制 SSL 除外
【发布时间】:2012-10-01 18:08:26
【问题描述】:

我想强制我网站上的每个页面都使用 SSL (https),​​除了主页 index.php 使用 .htccess

【问题讨论】:

    标签: apache .htaccess http


    【解决方案1】:

    在文档根目录的 htaccess 文件中,添加以下规则:

    RewriteEngine On
    RewriteCond %{HTTPS} !on
    RewriteCond %{REQUEST_URI} !^/(index.php)?$ 
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
    

    【讨论】:

      猜你喜欢
      • 2014-06-19
      • 1970-01-01
      • 1970-01-01
      • 2015-07-09
      • 1970-01-01
      • 2013-01-15
      • 2015-02-25
      • 1970-01-01
      • 2015-07-14
      相关资源
      最近更新 更多