2016-10-27 16 views
0

即使我允許它在robot.txt文件中後,Google bot仍不能讀取我的css和js。 該網站建立在Wordpress中。 以下是我的robot.txt文件。即使允許在Robot.txt中後,Google Bot仍然無法讀取我的CSS和js

User-agent: * 
Allow:/
Disallow: /wp-admin/ 
Disallow: /timeclock/ 
Disallow: /staging/ 

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$ 

User-agent: Googlebot 
Allow:/
Allow: /* .js* 
Allow: /* .css* 
+0

我覺得你不需要使用'允許:/ * .js文件*''允許:/ *的CSS *'試圖撲滅*並寫入'Allow:/ .css *' 這個命令*通常它是用於打開/ *並由*/ 關閉所以你可以看到你必須刪除,並在我認爲工作後。 –

回答

0

像我在評論中寫的,你不需要//*這是用於添加一個筆記,並打開/ *和關閉* /。試着改變你的代碼以這種方式,看看是否工作:

User-agent: * 
Allow:/
Disallow: /wp-admin/ 
Disallow: /timeclock/ 
Disallow: /staging/ 

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$ 

User-agent: Googlebot 
Allow:/
Allow: /.js 
Allow: /.css 
+0

謝謝你的時間。但仍然沒有工作。 –

+0

但爲什麼你想讓谷歌讀你的CSS?如果你有一些內容谷歌將從HTML讀取。 –

相關問題