Google网站管理员工具:无法阅读robots.txt

时间:2016-05-05 20:46:27

标签: .htaccess robots.txt google-webmaster-tools

我有一个网站,其中所有连接都将被重定向(从http://)到https://

这是我在.htaccess中的方式:

RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L]

这很完美,但是......

Google网站管理员并不是非常喜欢它。它无法读取我的robots.txt。参见

  

link screendump robots.txt Tester google webmaster tools

所以我加入了.htaccess:

RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{HTTP_HOST} ^example\.com/robots\.txt [NC]
RewriteRule ^robots.txt$ http://example.com/robots.txt [NC,L]

但这不起作用(足够),因为网站管理员工具也将其标记为失败!

这些链接没有失败:

http://www.example.com/robots.txt
https://www.example.com/robots.txt

但这些失败了:

http://example.com/robots.txt
https://example.com/robots.txt

我现在尝试了2天!非常欢迎一些帮助。

0 个答案:

没有答案