google 机器人仅显示 HTML 移动设备的结构不适用 CSS。为什么?
google robot only show HTML structure for mobile device not apply CSS. why?
我创建了一个带有响应式的 wordpress 网站,但是当我们在 google 中进行移动友好测试时,它向我显示 "your/my site is not mobile friendly"。
我观察到 CSS 不是由 google 机器人渲染的。我还允许 google 机器人使用 robot.text 文件在我们的站点中搜索 CSS 文件。
我将 robot.txt 文件代码放在下面:
User-Agent: *
Allow: /
Sitemap: http://example.com/sitemap.xml
Disallow: #Any folders we should not be allowing search bots to crawl.
Disallow: /wp-admin/
Disallow: /wp-content/cache
Disallow: /category/*/*
Disallow: /staging/
Disallow: /.hcc.thumbs/
Disallow: /10finsbury/
Disallow: /_db_backups/
Disallow: /affemailprdxn/
Disallow: /ajax/
Disallow: /assets_old/
Disallow: /assets_unk/
Disallow: /build_unk/
Disallow: /cgi_unk/
Disallow: /ciheropractice/
Disallow: /dekadesign-galaxy/
Disallow: /dekadesign-seroquel/
Disallow: /demowp/
Disallow: /dpulp/
Disallow: /eddynamics/
Disallow: /eddynamics730/
Disallow: /empwpstaging/
Disallow: /facebook-api/
Disallow: /furiousminds/
Disallow: /galaxy-cms/
Disallow: /galaxy-image-testing/
Disallow: /galaxy-test/
Disallow: /handt/
Disallow: /icehouse/
Disallow: /inxpress/
Disallow: /lead-usa/
Disallow: /liebhauserhome-ps/
Disallow: /maintenance/
Disallow: /ngbyliebhauser/
Disallow: /ngrebuild/
Disallow: /PIEFiles/
Disallow: /themefiletrans/
Disallow: /thememedwards/
Disallow: /repository/
Disallow: /staging/
Disallow: /staging/prdxn/
Disallow: /stats/
Disallow: /timeclock/
Disallow: /qcoal/
Disallow: /zhero-palma/
Disallow: /zherokappl-cms/
Disallow: /wp-content/themes/theme-wp/ANZBAIJuly152013.php/ANZBAI
Disallow: /wp-login.php/
Disallow: /wp-register.php/
Disallow: /*.php$
Disallow: /*.inc$
Disallow: /p13n_*
Disallow: /*.dll
Disallow: /servicetechnologies/
Disallow: /servicetechnologies
Disallow: /servicetechnologies/*
Disallow: /work-projects
Disallow: /work-casestudy
Disallow: /testimonial
Disallow: /testimonial/
Disallow: /testimonial/*
User-agent: Mediapartners-Google*
Allow: /
User-agent: Googlebot-Image
Allow: /wp-content/uploads/
Allow: /*.css$
User-agent: Adsbot-Google
Allow: /
Allow: /*.css$
User-agent: Googlebot-Mobile
Allow: /
Allow: /*.css$
下面给出的屏幕短片:
就机器人而言,CSS 文件不是问题。当任何机器人(包括)GoogleBot 尝试为您的网站编制索引时,您的 header 是什么颜色都无关紧要。这就是 css 文件 永远不会 (即使您已在 robots.txt 中指定)索引的原因。所以不用担心,您的搜索列表不会受到任何影响。
我注意到 CSS 文件块来自 .htaccess 文件。
所以我已经从 .htaccess 文件中删除了这些行,现在它工作正常。问题已解决。
感谢您的评论。
我创建了一个带有响应式的 wordpress 网站,但是当我们在 google 中进行移动友好测试时,它向我显示 "your/my site is not mobile friendly"。
我观察到 CSS 不是由 google 机器人渲染的。我还允许 google 机器人使用 robot.text 文件在我们的站点中搜索 CSS 文件。
我将 robot.txt 文件代码放在下面:
User-Agent: *
Allow: /
Sitemap: http://example.com/sitemap.xml
Disallow: #Any folders we should not be allowing search bots to crawl.
Disallow: /wp-admin/
Disallow: /wp-content/cache
Disallow: /category/*/*
Disallow: /staging/
Disallow: /.hcc.thumbs/
Disallow: /10finsbury/
Disallow: /_db_backups/
Disallow: /affemailprdxn/
Disallow: /ajax/
Disallow: /assets_old/
Disallow: /assets_unk/
Disallow: /build_unk/
Disallow: /cgi_unk/
Disallow: /ciheropractice/
Disallow: /dekadesign-galaxy/
Disallow: /dekadesign-seroquel/
Disallow: /demowp/
Disallow: /dpulp/
Disallow: /eddynamics/
Disallow: /eddynamics730/
Disallow: /empwpstaging/
Disallow: /facebook-api/
Disallow: /furiousminds/
Disallow: /galaxy-cms/
Disallow: /galaxy-image-testing/
Disallow: /galaxy-test/
Disallow: /handt/
Disallow: /icehouse/
Disallow: /inxpress/
Disallow: /lead-usa/
Disallow: /liebhauserhome-ps/
Disallow: /maintenance/
Disallow: /ngbyliebhauser/
Disallow: /ngrebuild/
Disallow: /PIEFiles/
Disallow: /themefiletrans/
Disallow: /thememedwards/
Disallow: /repository/
Disallow: /staging/
Disallow: /staging/prdxn/
Disallow: /stats/
Disallow: /timeclock/
Disallow: /qcoal/
Disallow: /zhero-palma/
Disallow: /zherokappl-cms/
Disallow: /wp-content/themes/theme-wp/ANZBAIJuly152013.php/ANZBAI
Disallow: /wp-login.php/
Disallow: /wp-register.php/
Disallow: /*.php$
Disallow: /*.inc$
Disallow: /p13n_*
Disallow: /*.dll
Disallow: /servicetechnologies/
Disallow: /servicetechnologies
Disallow: /servicetechnologies/*
Disallow: /work-projects
Disallow: /work-casestudy
Disallow: /testimonial
Disallow: /testimonial/
Disallow: /testimonial/*
User-agent: Mediapartners-Google*
Allow: /
User-agent: Googlebot-Image
Allow: /wp-content/uploads/
Allow: /*.css$
User-agent: Adsbot-Google
Allow: /
Allow: /*.css$
User-agent: Googlebot-Mobile
Allow: /
Allow: /*.css$
下面给出的屏幕短片:
就机器人而言,CSS 文件不是问题。当任何机器人(包括)GoogleBot 尝试为您的网站编制索引时,您的 header 是什么颜色都无关紧要。这就是 css 文件 永远不会 (即使您已在 robots.txt 中指定)索引的原因。所以不用担心,您的搜索列表不会受到任何影响。
我注意到 CSS 文件块来自 .htaccess 文件。
所以我已经从 .htaccess 文件中删除了这些行,现在它工作正常。问题已解决。
感谢您的评论。