【发布时间】:2018-04-05 10:04:12
【问题描述】:
URL 在我的应用程序中运行良好。我的意思是它们是漂亮的 URL。喜欢 http://www.example.com/ 但是,当您使用 index.php (如 http://www.example.com/index.php)访问页面时,它也可以工作,这是我不想要的,因为它在站点地图中为一个页面显示了两个链接。一页没有index.php,另一页有index.php。站点地图的演示在这里https://www.xml-sitemaps.com/details-eln.6762418.html
这里是 .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>
【问题讨论】:
-
从站点地图中删除您不想要的似乎是最简单的解决方案。
-
正确。 bt 我想在应用程序端修复它。
标签: php apache .htaccess laravel-5 laravel-routing