因为web根目录中有其他的项目,就在根目录中建了一个laravel文件夹用来测试学习,访问http://localhost/laravel/public可以看到欢迎页。后来想去掉public,参考了这个网站http://tutsnare.com/remove-public-from-url-laravel/的第二个方法,直接访问http://localhost/laravel就可以看到欢迎页了。在学习路由的时候,添加了
Route::post('test', function()
{
return 'test';
});
然后访问http://localhost/laravel/test却一直是404,是哪里的问题呢?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
认证高级PHP讲师