【发布时间】:2020-12-04 09:33:25
【问题描述】:
在我使用 laravel 7.25 创建项目后(这是我第一次使用这个版本,我在最后一个项目中使用了 7.20)我在路由文件夹的 web.php 文件中创建路由
Route::get('/', function () {
return view('welcome');
});
Route::get('/test', function () {
dd("k");
});
当我尝试运行它们时,只有“/”有效,而“/test”未找到 404,但它可以在我朋友的设备上运行,我使用 xampp,这是 apache httpd.conf:
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
AllowOverride All
Require all granted
</Directory>
【问题讨论】:
-
为什么第二条路线不起作用?是有错误还是什么?请提供更多信息...
-
哦,是的,对不起,它只显示未找到 404
-
当你在控制台运行
php artisan route:list时,有/test路由吗? -
是的,动作是关闭