robots.txt - Robot.txt 允许域中指定的 URL

标签 robots.txt

我只想允许主 URL(域)和 http://domain/about,其他 URL 对搜索 google 不可见。示例我的链接如下:

http://example.com
http://example.com/about
http://example.com/other1
http://example.com/other2
http://example.com/other3
http://example.com/other4
http://example.com/other5
http://example.com/other6
and more URL. 

我的问题是 robots.txt 的内容,我只想允许 http://example.comhttp://example.com/about ,我的网站使用 WordPress。

谢谢。

最佳答案

你想要的是:

User-agent: *
Allow: /$
Allow: /about
Disallow: /

$ 表示 url 字符串必须在此结束。因此它不允许,例如 /example.com/foo

关于robots.txt - Robot.txt 允许域中指定的 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14598802/

相关文章:

seo - 谷歌站长工具和重复链接

seo - 如何避免谷歌索引我的网站正在开发中完成

seo - 我已经禁止一切 10 天

php - Robots.txt 和元数据标记是否足以阻止搜索引擎索引依赖于 $_GET 变量的动态页面?

.htaccess - Robots.txt、php.ini、connect_to_database.php、.htaccess

html - 如何让 robots.txt 在 "?"字符之后阻止访问网站上的 URL,但索引页面本身?

seo - robots.txt - 排除任何包含 "/node/"的 URL

.htaccess - 如何限制网站被索引

node.js - robots.txt 未通过 node.js 路由显示发送纯文本

php - SEO 排除特定文件夹/页面