2014-01-24 29 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