【问题标题】:SSL Ceriticate & Htaccess & SEOSSL 证书 & Htaccess & SEO
【发布时间】:2015-11-13 17:39:51
【问题描述】:

我想将 ssl 证书添加到我的新闻站点。但是不想通过将 http 网址更改为 https..

来获得 SEO 惩罚或 seo 排名降低

我的 htaccess 文件现在是这样的:

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

我打算这样改变它:

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http**s**://www.%{HTTP_HOST}/$1 [R=301,L]

另外,我会将所有 http url 转换为 html 源代码中的 https...

不被 Google 处罚就足够了吗?

【问题讨论】:

  • 我投票结束这个问题作为题外话,因为它要求 SEO 建议(如果有什么受到惩罚)。这可能是Webmasters 的主题。

标签: .htaccess http ssl https seo


【解决方案1】:

您将http url 更改为https,但前提是该url 没有www

改用:

# Without IP
RewriteCond %{HTTP_HOST} ^[0-9.]+$
RewriteRule ^ - [L]

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]

或者如果你将它与其他规则一起使用:

RewriteCond %{HTTP_HOST} !^(?:www\.|[0-9.]+$) [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]
RewriteCond %{HTTP_HOST} !^[0-9.]+$
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]

【讨论】:

  • 我可以说,'添加 www;除了 IP 地址使用'.. 因为:正常的 .com url 是可以的......但是,这个条件添加了 www。知识产权之前;如果我写 IP 地址来打开网站..
  • 我只是为此添加测试
猜你喜欢
  • 2016-11-12
  • 2010-12-03
  • 2018-08-23
  • 1970-01-01
  • 2017-06-13
  • 2019-03-29
  • 2020-07-17
  • 2014-01-05
相关资源
最近更新 更多