现在,/post/总会跳到别的页面,而不是跳到/post的位置。
我的laravel版本是4.2,下面是测试代码。
php
Route::get('post', function() { return 'w/out slash'; }); Route::get('post/', function() { return 'with slash'; });
php
Route::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/
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://localhost/post">here</a>.</p>
</body></html>
http://stackoverflow.com/questions/22063520/laravel-slash-after-url-re...