1

我的WordPress网站上有一些Google索引问题。 当我将我的网站谷歌网站管理员的.htaccess是以下Googlebot无法访问我的WordPress robots.txt

<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文件,但谷歌仍然没有索引我的网站。

# 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 

我在哪里做错了?

+0

请尝试删除** SetEnvIfNoCase User-Agent。* google。* search_robot **部分然后重新提交。 –

+0

我是一个防火墙问题。谢谢大家 – bit

回答

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

+0

我做了这些改动,但谷歌仍然无法访问robots.txt。如果我检查机器人的可用性,测试以成功结束。但机器人测试工具有一个空机器人 – bit