【问题标题】:Force https:// cause problems in htaccess强制 https:// 导致 htaccess 出现问题
【发布时间】:2015-05-20 07:54:18
【问题描述】:

我有一个 htaccess 文件,它强制所有内容加载特定的 https 地址。

我们有两个域,比如说 web.no 和 website.no。

web.no 指向 website.no,但我有一个子域 dev.web.no,我不想重定向到 website.no

规则是

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://website.no/%{REQUEST_URI} [L,R=301]

如何为 dev.web.no 设置例外?

【问题讨论】:

标签: apache .htaccess http https


【解决方案1】:

你可以使用:

RewriteEngine On

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !=dev.web.no
RewriteRule ^ https://website.no/%{REQUEST_URI} [L,R=301,NE]

【讨论】:

    猜你喜欢
    • 2018-11-29
    • 1970-01-01
    • 1970-01-01
    • 2014-09-29
    • 1970-01-01
    • 2012-06-17
    • 2016-09-14
    • 2020-09-27
    • 1970-01-01
    相关资源
    最近更新 更多