【发布时间】:2015-03-12 17:57:00
【问题描述】:
我想为我的网站制作一个使用 Laravel 框架制作的站点地图。 Laravel 应用程序中默认的 .htaccess 文件如下所示:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
据我所知,这个 .htacces 将每个请求重定向到 index.php。现在如果 sitemap.xml 文件在根目录中并且 robots.txt 是站点地图的路径怎么办?搜索引擎机器人应该发出像“www.example.com/sitemap.xml”这样的请求来查找和读取站点地图文件,对吧?但是,当 .htaccess 将每个请求重定向到 index.php 时,机器人如何找到该文件?
【问题讨论】:
标签: .htaccess laravel seo sitemap bots