.htaccess http://www.和 http:// :对 SEO 有什么影响?

发布于 2024-09-25 04:30:35 字数 502 浏览 0 评论 0原文

我正在尝试提高我的 SEO 排名:我使用 http://www.woorank.com 工具 我有一个“严重错误”告诉​​我:

确保http://roulette-chat.frhttp://www.roulette-chat.fr 是 不并行运行。

重定向来自 非首选主机名很重要 因为搜索引擎会考虑 URL 有和没有“www”作为两个 不同的网站。

设置您的首选域后,请使用 将所有流量重定向至您的 301 非首选域。

有人可以告诉我如何使用 .htaccess 解决这个问题吗? 问候

I am trying to improve my SEO rank : I use http://www.woorank.com tool
I have a "sever error" that tells me:

Be sure that http://roulette-chat.fr
and http://www.roulette-chat.fr are
not running in parallel.

Redirecting requests from a
non-preferred hostname is important
because search engines consider URLs
with and without "www" as two
different websites.

Once your preferred domain is set, use
a 301 redirect for all traffic to your
non-preferred domain.

Can someone tell me how to solve this issue with the .htaccess ?
regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

兲鉂ぱ嘚淚 2024-10-02 04:30:35

将 example.com 替换为您的域名。

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

Replace example.com with your domain name.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^example\.com$
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
梦屿孤独相伴 2024-10-02 04:30:35

或者,如果您想强制使用“www”:

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

有很多人属于无 www 阵营(我曾经是其中之一),但请记住,这可能会限制子域的使用。

通过将一个重定向到另一个(无 www 到 www,反之亦然),您可以有效地将反向链接整合到您的域的一个版本。主要搜索引擎将 www 和 no-www 视为单独的页面。您还可以使用 rel=canonical 链接元素,如下所述:http ://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html

Alternatively, if you want to force the 'www' use:

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

There are plenty of people in the no-www camp (I used to be one), but remember this can limit the use of sub-domains.

By redirecting one to another (no-www to www or vice versa), you effectively consolidate backlinks to one version of your domain. The major search engines treat www and no-www as seperate pages. You can also make use of the rel=canonical link element as described here: http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文