【问题标题】:Disable SSL on a specific URL在特定 URL 上禁用 SSL
【发布时间】:2018-06-18 15:09:46
【问题描述】:

我想从单个链接禁用 https,强制它使用 http。

https://tipografiasartore.it/autodiscover/autodiscover.xml

我将此字符串添加到我的 .htaccess 文件中,但它不起作用:

RewriteEngine on
RewriteCond %{HTTPS} on
RewriteRule ^autodiscover/autodiscover.xml http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

到目前为止我的 .htaccess:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule . /index.php [L]
    </IfModule>
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

RewriteEngine on
RewriteCond %{HTTPS} on
RewriteRule ^autodiscover/autodiscover.xml http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

【问题讨论】:

  • 您有这样做的理由吗?我不知道你的问题的答案,只是好奇?
  • 我只是在测试一个将从该 url 获取数据的 Exchange 服务

标签: wordpress .htaccess url


【解决方案1】:

您可以使用以下规则将https://tipografiasartore.it/autodiscover/autodiscover.xml 重定向到其http 版本

RewriteEngine on

RewriteCond %{HTTPS} on
RewriteRule ^autodiscover/autodiscover.xml http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

【讨论】:

  • 我已将此代码添加到 .htaccess 的底部,但我仍然无法访问 http 版本。我已经在问题中更新了上面的 .htaccess 代码。
【解决方案2】:

我建议你试试这个代码。肯定会成功的。

重写引擎开启 RewriteCond %{HTTPS} 开启 RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-02-04
    • 2017-07-31
    • 1970-01-01
    • 2016-01-04
    • 2020-03-04
    • 2016-06-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多