css - 样式表在呈现后被 Google 阻止

标签 css magento stylesheet robots.txt

在 Google Search Condole (Fetch as Google) 中呈现我的网站时,我发现我网站的样式表被阻止了。获取状态显示“部分”。我怀疑这是我的网站未显示在 Google 搜索结果中的原因。

但是,将我的网站添加到 Bing 搜索引擎后,一个小时后它就会显示在搜索结果中。因此,我的网站在 Bing 中没有遇到任何索引编制问题。

如何允许 Googlebot 访问我网站的 CSS 文件?

我正在使用 Magento 网站。以下是从 Search Console 获取的详细信息:

http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/css/styles.css3.php?url=http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/    Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/css/bootstrap.css Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/css/bootstrap-theme.css   Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/css/font-awesome.css  Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/css/font-awesome.min.css  Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/css/styles.css    Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/base/default/css/widgets.css Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/magentothem/fancybox/jquery.fancybox.css  Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/magentothem/ajaxcartsuper/ajax_cart_super.css Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/magentothem/css/categorytabsliders.css    Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/magentothem/css/custommenu.css    Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/magentothem/imagerotator/effect.css   Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/layerednavigationajax/jquery-ui.css   Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/magentothem/css/ma.upsellslider.css   Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/magentothem/css/ma.verticalmenu.css   Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/magentothem/css/ma.banner7.css    Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/magentothem/css/ma.brandslider.css    Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/css/print.css Style Sheet Blocked robots.txt Tester
http://www.cherryconcept.com/skin/frontend/default/ma_sahara_fashion5/images/logo.png   Image   Blocked robots.txt Tester

这是我的robots.txt:

# Google Image Crawler Setup
User-agent: Googlebot-Image
Disallow:

# Crawlers Setup

# Directories
Disallow: /404/
Disallow: /app/
Disallow: /cgi-bin/
Disallow: /downloader/
Disallow: /errors/
Disallow: /includes/
#Disallow: /js/
#Disallow: /lib/
Disallow: /magento/
#Disallow: /media/
Disallow: /pkginfo/
Disallow: /report/
Disallow: /scripts/
Disallow: /shell/
Disallow: /skin/
Disallow: /stats/
Disallow: /var/

# Paths (clean URLs)
Disallow: /index.php/
Disallow: /catalog/product_compare/
Disallow: /catalog/category/view/
Disallow: /catalog/product/view/
Disallow: /catalogsearch/
#Disallow: /checkout/
Disallow: /control/
Disallow: /contacts/
Disallow: /customer/
Disallow: /customize/
Disallow: /newsletter/
Disallow: /poll/
Disallow: /review/
Disallow: /sendfriend/
Disallow: /tag/
Disallow: /wishlist/
Disallow: /catalog/product/gallery/

# Files
Disallow: /cron.php
Disallow: /cron.sh
Disallow: /error_log
Disallow: /install.php
Disallow: /LICENSE.html
Disallow: /LICENSE.txt
Disallow: /LICENSE_AFL.txt
Disallow: /STATUS.txt

# Paths (no clean URLs)
Disallow: /*.php$
Disallow: /*?SID=

最佳答案

您发布的robots.txt 似乎不是you're currently using .您当前的 robots.txt 包含:

User-agent: Googlebot
Allow: /blocked-folder/css/
Allow: /blocked-folder/java/

...

Disallow: /skin/

因此,您明确告诉 Googlebot 不要获取 /skin 目录中的文件。

编辑:您还有以下规则

Disallow: /*.php$

禁止所有 PHP 文件。删除这些行,你会没事的。

关于css - 样式表在呈现后被 Google 阻止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28645414/

相关文章:

php - Magento 中的购物车总计不含运费

php - 为什么 Magento 在生成 ID 后无法保存客户?

javascript - 性能友好的闪烁效果

php - 从 PHP 下载图像,它包含一堆 html 和 css 代码而不是图像

html - 在 ie6 中溢出父 div 之外的内容

css - Google Chrome 中的字体呈现问题

php - 扩展 Magento 购物车

html - 样式表的相对链接在本地机器上不起作用,在线工作。为什么是这样?

css - 关于 smartgwt 元素的 css 文件的问题

google-chrome - Chrome仅加载IE样式表