報價Google Webmaster Docs
如果我抓取使用robots.txt頁塊谷歌會禁止 指令,將它從搜索結果中消失嗎?
阻止Google抓取頁面可能會降低該頁面的排名或導致它隨着時間的推移完全失效。它還可以 減少在 搜索結果下的文本中向用戶提供的詳細信息量。這是因爲如果沒有頁面的內容,搜索引擎 的信息要少得多。
-
然而,robots.txt中屏蔽並不能保證一個頁面將不會 顯示在搜索結果:谷歌可能仍然決定,基於外部 信息,如導入鏈接,它是相關的。如果您希望 明確阻止頁面被索引,則應該使用noindex機器人元標記或X-Robots-Tag HTTP標頭的 。在這種情況下, 您不應該禁止robots.txt中的頁面,因爲必須抓取頁面 才能看到和遵守標記。
爲文件夾中的所有文件設置帶noindex的X-Robots-Tag標頭。從您的web服務器配置文件夾中設置此標題。從Apache配置https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag?hl=de
組頭PDF文件:
<Files ~ "\.pdf$"> Header set X-Robots-Tag "noindex, nofollow" </Files>
禁用目錄index'ing /此文件夾的清單。
用「noindex」機器人元標記添加一個空的index.html。
<meta name="robots" content="noindex, nofollow" /> <meta name="googlebot" content="noindex" />
使用站長工具手動強制刪除索引的網頁。
問題的評論:如何禁止該文件夾中的所有文件?
// 1) Deny folder access completely
<Directory /var/www/denied_directory>
Order allow,deny
</Directory>
// 2) inside the folder, place a .htaccess, denying access to all, except to index.html
Order allow,deny
Deny from all
<FilesMatch index\.html>
Allow from all
</FilesMatch>
// 3) allow directory, but disallow specifc environment match
BrowserMatch "GoogleBot" go_away_badbot
BrowserMatch ^BadRobot/0.9 go_away_badbot
<Directory /deny_access_for_badbot>
order allow,deny
allow from all
deny from env=go_away_badbot
</Directory>
// 4) or redirect bots to main page, sending http status 301
BrowserMatch Googlebot badbot=1
RewriteEngine on
RewriteCond %{ENV:badbot} =1
RewriteRule ^/$ /main/ [R=301,L]
這不是真的與編程有關,並且最好在http://webmasters.stackexchange.com/上提問。 – Sugar 2014-09-10 11:53:09
即使我們應用robot.txt google也會搜索文件夾。我們需要用密碼限制目錄。最好將index.html文件放在所有目錄中以避免列出文件。 – sugunan 2014-09-10 12:01:24
問題[轉貼給網站管理員](http://webmasters.stackexchange.com/q/68958/17633)。 – unor 2014-09-13 12:43:07