【问题标题】:Allowing external Javascript file to be crawled允许抓取外部 Javascript 文件
【发布时间】:2018-10-14 12:59:48
【问题描述】:

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

我的网站在谷歌控制台中出现以下错误

资源:

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

【问题讨论】:

    标签: seo robots.txt googlebot x-cart google-console-developer


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2015-10-19
      • 2012-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-03
      • 1970-01-01
      • 2013-10-04
      相关资源
      最近更新 更多