【问题标题】:Redirect from HTTPS to HTTP [closed]从 HTTPS 重定向到 HTTP [关闭]
【发布时间】:2013-12-22 18:43:58
【问题描述】:

我的网站页面 www.itcontractorsuk.com/contractor_mortgages.php 已被 Google 索引中的 https 版本索引,即https://www.itcontractorsuk.com/contractor_mortgages.php

但是,我已从我的网站上卸载了 SSL,但 Google 仍将页面的 https 版本保留在其索引中。因此,当有人点击 https 版本时,会出现 107 SSL 错误。

有没有办法可以在 .htaccess 文件中写入一些东西,将 https 请求重定向到 http,即http://www.itcontractorsuk.com/contractor_mortgages.php

【问题讨论】:

标签: php .htaccess url-redirection


【解决方案1】:

您应该使用R=301 告诉搜索引擎更新他们的链接。将此代码放入您的DOCUMENT_ROOT/.htaccess 文件中:

RewriteEngine On

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-11-19
    • 1970-01-01
    • 2013-12-03
    • 2019-09-10
    • 2017-10-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多