抱歉,找不到您要查找的页面 - Laravel 5.2


Sorry, the page you are looking for could not be found - Laravel 5.2

这是我的Routes.php

Route::get('invitation/{id}/{query_string}' , 'Invitationscontroller@invitation_link');

这是我的Invitationscontroller.php

public function invitation_link(){
        return "Hello";
    }

当我点击这个网址时example.com/invitation/1/exUgWa0apsAmeAzyBLruYvR0S6WqtYBH

我收到错误,因为

RouteCollection 中的 NotFoundHttpException .php第 161 行:

我缺什么?

任何帮助将不胜感激。谢谢。

我通常通过发出命令来清除缓存并重新生成自动加载文件来解决此类问题:

php artisan route:clear
composer dump-autoload

编辑

如果您使用 Apache:

  • 检查您的 Apache 配置并允许 .htaccess 覆盖
  • 启用mod_rewrite
  • 检查您的.htaccess文件是否与Laravel提供的相同

打开/public/index.php然后将$app->run();更改为$app->run($app['request']);

那会起作用。