会吗?L5 Route
组件的行为我记得是:
GET
如此);以下是测试用例与结果:
$ diff my_l5_app/app/Http/routes.php l5_fresh/app/Http/routes.php
22,24d21
<
< Route::get('post/', function() { return 'with slash'; });
< Route::get('post', function() { return 'w/out slash'; });
$ curl http://test1.l5.invalid/post/
这里Web server提示了301跳转到 http://test1.l5.invalid/post
SF的前台渲染有误,结果见 http://pastebin.com/ZMh0smvq
$ curl http://test1.l5.invalid/post
w/out slash
Case 2
$ diff my_l5_app/app/Http/routes.php l5_fresh/app/Http/routes.php
22,24d21
<
< Route::get('post', function() { return 'w/out slash'; });
< Route::get('post/', function() { return 'with slash'; });
$ curl http://test1.l5.invalid/post/
这里Web server提示了301跳转到 http://test1.l5.invalid/post
SF的前台渲染有误,结果见 http://pastebin.com/ZMh0smvq
$ curl http://test1.l5.invalid/post
with slash
因为 /post/和/post 是两个路由路径, 要让他俩指向一个位置,分配配置他俩,都指向同一个位置。
Laravel不知道,不过其他路由我都是后边加?的
/post/?