2014-01-24 32 views
0

我想獲得robots.txt的工作,使搜索引擎索引開始我的網站,並顯示類似的描述等元信息請告訴我正確的使用方法的robots.txt

不過,我得到這個消息:

A description for this result is not available because of this site's robots.txt – learn more. 

下面是我的robots.txt的外觀。

# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 
# 
# To ban all spiders from the entire site uncomment the next two lines: 
User-agent: * 
Disallow: /tags/* 
Disallow: /users/* 

我需要改變什麼。

這是一個Rails4應用程序託管在Heroku和公共目錄中的Rails庫

+1

這個問題似乎是脫離主題,因爲它是關於SEO –

+0

@JohnConde不知道你的意思。搜索引擎優化,需要你編寫代碼,並獲得一個Web應用程序運行應該是stackoverflow的問題。事實上,很多有關新應用程序和增長的工作都會涉及到增長黑客行爲。 – codeObserver

+1

@JohnConde這個問題是關於robots.txt,針對一個特定的問題,並被正確標記。看起來沒問題。 – Substantial

回答

1

首先,它不是強制性的使用robots.txt文件!如果您不希望搜索引擎抓取您網站的特定頁面或目錄,則只需要使用它們即可。

在你的情況下,你正在限制搜索引擎抓取根目錄上的標籤和用戶目錄。現在,該目錄內的任何頁面都會出現此錯誤。

我還建議使用Google網站管理員工具並驗證您的網站。您可以從那裏測試Robots.txt文件。

1

嘗試刪除一些星號:

User-agent: * 
Disallow: /tags/ 
Disallow: /users/ 

同時,提供給您的站點地圖的位置可能也有幫助:

Sitemap: www.yoursite.com/sitemap.xml 
+0

感謝@Vidya的迴應。我會試試看。一些網站使用星號https://www.airbnb.com/robots.txt,http://www.quora.com/robots.txt 感謝關於提到sitemap.xml。我會讀更多關於它。 – codeObserver

+0

我試圖刪除星號。它沒有工作。 – codeObserver