http - 规范 URL 链接

标签 http https seo canonical-link

我正在使用规范的 url 链接

<link rel="canonical" href="http://test123.com" />

避免站点的 http 和 https 版本之间出现重复内容问题。 目前我已经设置好 http 和 https 版本在头部都有规范链接。

这是正确的还是我应该只在 https 版本的头部部分有规范链接而在 http 版本上什么都没有?还是两者都有关系?

(我希望机器人索引我的 http 版本而不是我的 https 版本)。

最佳答案

在我看来,您可以像这样在 http 中设置您的规范 url

<link rel="canonical" href="http://test123.com" />

对于 http 和 https。机器人将索引您的 http 规范 url。如果您需要该页面的 https 版本,您可以在 http 页面上进行重定向。如果用户转到 http://test123.com,您可以根据需要将用户重定向到 https 页面。

关于http - 规范 URL 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10297188/

相关文章:

php - curl OpenSSL错误141A318A tls_process_ske_dhe :dh key too small

php - 如何为我的 codeigniter 网站编写 .htaccess 文件

http - nginx 没有那个文件或目录

asp.net - 有什么理由我不应该自动修剪 html 表单参数吗?

web-services - 轴 2 和 Rampart-为什么服务返回 wsse :Security header in request?

php - 如何设置 SeoBundle 和提取标题?

seo - Google Rich Snippets 不起作用

使用表单的 PHP HTTP 基本身份验证

http - 临时维护页面的最佳实践方法和状态代码是什么?

apache - 使用通配符子域和 ssl 设置复杂的 htaccess