【发布时间】:2019-08-14 17:26:13
【问题描述】:
以前,我曾阻止搜索引擎机器人以防止使用 robots.txt 文件抓取我的网站,但现在我想取消阻止它们。
我更新了 robots.txt 文件并允许搜索引擎机器人抓取我的网站,但搜索引擎似乎仍在使用我的旧 robots.txt 文件,我如何告诉搜索引擎使用我的新 robots.txt 文件?还是我的 robots.txt 文件有问题?
我的旧 robots.txt 文件的内容:
User-agent: *
Disallow: /
我的新 robots.txt 文件的内容:
User-agent: *
Allow: /
# Disallow these directories, url types & file-types
Disallow: /trackback/
Disallow: /wp-admin/
Disallow: /wp-content/
Disallow: /wp-includes/
Disallow: /xmlrpc.php
Disallow: /wp-
Disallow: /cgi-bin
Disallow: /readme.html
Disallow: /license.txt
Disallow: /*?*
Disallow: /*.php$
Disallow: /*.js$
Disallow: /*.inc$
Disallow: /*.css$
Disallow: /*.gz$
Disallow: /*.wmv$
Disallow: /*.cgi$
Disallow: /*.xhtml$
Disallow: /*/wp-*
Disallow: /*/feed/*
Disallow: /*/*?s=*
Disallow: /*/*.js$
Disallow: /*/*.inc$
Allow: /wp-content/uploads/
User-agent: ia_archiver*
Disallow: /
User-agent: duggmirror
Disallow: /
Sitemap: https://example.com/sitemap.xml
【问题讨论】:
-
新 robots.txt 中的错误:记录中不允许有空行(每条记录都以
User-agent行开头)。您也可以删除Allow: /(因为这是默认设置)。
标签: seo robots.txt