现在,/post/总会跳到别的页面,而不是跳到/post的位置。
我的laravel版本是4.2,下面是测试代码。
phpRoute::get('post', function() { return 'w/out slash'; }); Route::get('post/', function() { return 'with slash'; });
phpRoute::get('post/', function() { return 'with slash'; }); Route::get('post', function() { return 'w/out slash'; });
以上两种配置,结果都如下,都是/post/ 301 跳到别的页面,/post页面正常。
curl http://localhost/gitcafe/public/post
with slash
curl http://localhost/gitcafe/public/post/
301 Moved Permanently
Moved Permanently
The document has moved here.
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
因为 /post/和/post 是两个路由路径, 要让他俩指向一个位置,分配配置他俩,都指向同一个位置。
Laravel不知道,不过其他路由我都是后边加?的
/post/?