The following code
Route::get('test/{n}', function ($n) {
return $n;
});
App::missing(function () {
return Response::make("Dude, that's a 404 !", 404);
});
works with anything like
http://localhost/myproject/public/test/something
but
http://localhost/myproject/public/test/
redirects to
http://localhost/test
I believe it should instead display
Dude, that's a 404 !
I might have missearched the SO forum, but does anyone have an explanation on this strange behavior ?
EDIT : @Mohammad Walid
Okay, so, I changed my routes.php to this :
Route::get('/', 'HomeController@showWelcome');
Route::get('test', function () {
return 'test';
});
App::missing(function () {
return Response::make("Dude, that's a 404 !", 404);
});
I have not removed the line you talked about in public/.htaccess
.
This works :
base_url/test
But this doesn't (redirects to localhost/test
) :
base_url/test/
How can that be, since you said that removing the line would remove that feature ?
EIDT 2 :
Since it turns out that the problem comes from MAMP not interpreting the trailing slashes redirect condition correctly, a bug report was created in the MAMP bug base :