【问题标题】:Disable HTTP version of site Wordpress禁用网站 Wordpress 的 HTTP 版本
【发布时间】:2021-07-16 09:10:13
【问题描述】:

主页是https://example.com/。机器人认为http://example.com/ 也是主页。如何禁用所有 http 页面的索引?

【问题讨论】:

    标签: wordpress http https sitemap robots.txt


    【解决方案1】:

    假设您为 SSL 设置了正确的重定向。试试这个。

    转到Dashboard->Settings->General Settings

    将 WordPress 地址 (URL) 从 http://example.com/ 更改为 https://example.com/

    PS : 这会将您重定向到网站的 https 版本并注销您。仅当您的侧的 https 版本有效时才执行此操作,否则您必须进行一些手动更改才能撤消此更改。

    您可以继续从 Google Search Console 管理器中对所有 http 链接取消索引。我建议在这里询问任何与 seo 相关的问题(影响):https://webmasters.stackexchange.com/

    最好使用重写规则将所有 http 重定向到 https。

    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://example.com/$1 [R,L]
    

    【讨论】:

    • 嗨!谢谢您的回答。我已经在 WP 设置中有https://example.com/。此外,所有 HTTP 链接都已在 HTTPS 上重定向。我想使用 robots.txt 或站点地图从索引中排除 HTTP
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-01-16
    • 1970-01-01
    • 1970-01-01
    • 2021-09-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多