0

我只想在一个搜索引擎中获得...

http://mysite.com/
索引,而不是...

http://mysite.com/index.php
我只想允许索引网站的主页,仅此而已。我不希望机器人跟随主页上的任何链接。

我的元标记包括以下内容:

<meta name="robots" content="index, nofollow" />

我的 robots.txt 包括以下内容:

User-agent: Googlebot
Allow: /index.php
Disallow: /

User-agent: *
Disallow: /

这会达到我想要的结果吗?

提前致谢!

4

2 回答 2

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

把它放在.htaccess中。

这直接来自Apache 的 URL 重写指南

于 2010-09-22T02:09:28.337 回答
1

指定您的规范:

来自http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html

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

在你的<head>

于 2010-09-22T02:17:51.843 回答