1

我在谷歌控制台中的网站遇到问题

我在我的网站的谷歌控制台中遇到错误

资源:

https://api.html5media.info/1.1.5/html5media.min.js 

Type : Script   

Status : Googlebot blocked by robots.txt

我的网站在 xcart 中,我的 robots.txt 包含

User-agent: Googlebot
Disallow: /*printable=Y*
Disallow: /*js=*
Disallow: /*print_cat=*
Disallow: /*mode=add_vote*

User-agent: *
Allow: *.js
Allow: *.css
Allow: *.jpg
Allow: *.gif
Allow: *.png
Disallow: /admin/
Disallow: /catalog/
Disallow: /customer/
Disallow: /files/
Disallow: /include/
....

我试着改变

User-Agent: Googlebot
Disallow: /*printable=Y*
Disallow: /*print_cat=*
Disallow: /*mode=add_vote*
Allow: .js

但是上面的代码没有运气。有人有解决方案吗?我如何使用我的 robots.txt 允许 google bot 允许的第三方 js

4

1 回答 1

2

如果 .js 文件位于您无法控制的第三方站点上,那么不,无法从您的站点取消阻止它。给定的 robots.txt 文件仅控制对加载 robots.txt 文件的域/子域上的文件的抓取。要取消阻止此文件,您需要能够更改第三方域上的 robots.txt 文件。(我假设你不能在这里这样做)

解决这个问题的最简单方法是将 js 文件复制到您自己的服务器,并在那里链接到它。

于 2018-05-05T02:54:16.733 回答