【问题标题】:Routing is not working laravel 5?路由不工作 laravel 5?
【发布时间】:2016-05-15 08:09:15
【问题描述】:

我刚刚安装了新的 laravel 5.1,只有根页面显示

Route::get('/', function () {

    return view('welcome');
});

它工作得很好,但没有任何其他路线不工作 喜欢:

Route::get('user', function () {
   return "hello";
});

它抛出未找到的异常 404。请帮助我摆脱困境。提前致谢。

【问题讨论】:

  • 检查您的 htaccess 文件并检查天气 mod_rewrite 是否启用
  • 感谢 chetan 现在工作正常!

标签: php laravel-5 routes laravel-routing


【解决方案1】:

这可能是因为您的系统中没有启用重写模式。要么启用它,要么使用 index.php 通过以下 url 访问

http://localhost/blog/public/index.php/user

【讨论】:

  • 最好开启重写模式
猜你喜欢
  • 1970-01-01
  • 2021-11-24
  • 1970-01-01
  • 2015-08-09
  • 2015-06-10
  • 1970-01-01
  • 2013-11-26
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多