【发布时间】:2016-03-23 14:26:37
【问题描述】:
我现在在我的项目中使用robots.txt、sitemap.xml 和.htaccess,如果我在 Google 网站管理员工具中提交它们,我的 sitemap.xml 网址会出现访问错误。
robots.txt
User-Agent: *
Disallow:
sitemap.xml
<url>
<loc>http://www.example.de/</loc>
<changefreq>daily</changefreq>
</url>
<url>
<loc>http://www.example.de/blog/article/</loc>
<changefreq>daily</changefreq>
</url>
<url>
<loc>http://www.exampe.de/blog/article/example-article</loc>
<changefreq>daily</changefreq>
</url>
.htaccess
RewriteRule ^(.*)blog/article/$ $1article.php
RewriteRule ^(.*)blog/article/example-article$ $1blog/example-article.php
我的文件夹结构:
├───blog
│ └─── example-article.php
├─── sitemap.xml
├─── robots.txt
├─── .htaccess
├─── article.php
├─── ...
谷歌网站管理员工具说:
http://www.example.de/blog/article/
http://www.example.de/blog/article/example-article
被 robots.txt 阻止,这是不可能的,因为我允许抓取所有内容。
我的错误在哪里?
【问题讨论】:
-
可能是因为您的 robots.txt 阻止了它。您的 robots.txt 看起来不正确。
-
是的,它被 robots.txt 阻止了。但是错误到底在哪里?我不能在机器人中使用 mod_rewrited 网址吗?因为我希望它们像那样被索引。
标签: .htaccess mod-rewrite sitemap robots.txt google-crawlers