不允许所有子robots.txt的格式URLsbut不是根URL本身

问题描述:

我的应用程序的URL像下面不允许所有子robots.txt的格式URLsbut不是根URL本身

http://example.com/app/1

http://example.com/app/2

http://example.com/app/3

...

http://example.com/app/n

现在我想阻止抓取这些网址,但不是http://example.com/app 我怎么可以这样使用robots.txt

以下内容添加到您的robots.txt

Disallow: /app/ 

这将使http://example.com/app但不是http://example.com/app/ * 您可以在这里测试您的robots.txt https://www.google.com/webmasters/tools/robots-testing-tool