【问题标题】:Googlebot cannot access my WordPress robots.txtGooglebot 无法访问我的 WordPress robots.txt
【发布时间】:2015-10-07 21:14:37
【问题描述】:

我的 WordPress 网站上的 Google 索引有些问题。 当我将我的网站添加到 Google 网站管理员时,.htaccess 如下

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

现在,我尝试将这些行添加到 .htaccess 文件中,但 Google 仍然没有索引我的网站。

# BOT SETTINGS
SetEnvIfNoCase User-Agent .*google.* search_robot
SetEnvIfNoCase User-Agent .*yahoo.* search_robot
SetEnvIfNoCase User-Agent .*bot.* search_robot
SetEnvIfNoCase User-Agent .*ask.* search_robot

Order Deny,Allow
#Deny from All
Allow from env=search_robot

我哪里做错了?

【问题讨论】:

  • 请尝试删除 SetEnvIfNoCase User-Agent .*google.* search_robot 部分,然后重新提交。
  • 我是防火墙问题。谢谢大家

标签: wordpress .htaccess robots.txt google-search-console googlebot


【解决方案1】:

创建 robots.txt 文件并使用以下代码上传您的 wordpress 根文件夹。

User-agent: google
Disallow:

User-agent: yahoo
Disallow:

User-agent: bot
Disallow:

User-agent: ask
Disallow:

User-agent: *
Disallow: /

并尝试在您的.htaccess 中删除#BOT SETTING

【讨论】:

  • 我做了这些更改,但谷歌仍然无法访问 robots.txt。如果我检查机器人的可用性,则测试以成功结束。但是 robots-testing-tools 有一个空机器人
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-01-22
  • 2014-01-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-10-19
相关资源
最近更新 更多