【问题标题】:Laravel Route Says Sorry, the page you are looking for could not be foundLaravel Route 说对不起,找不到您要找的页面
【发布时间】:2023-03-23 04:05:01
【问题描述】:

Laravel Route 说对不起,找不到你要找的页面。

您好,在此先感谢,请有人帮助我,我试图从两天内解决这个问题,但没有任何帮助。

我的路线还可以,但是当我更改路线时,他们会给出此消息

[Sorry, the page you are looking for could not be found.]

我的路线:

// The first one is working perfectly
Route::get('/', function () { return view('TeacherShow'); }); 
// But the second one is not working
Route::get('/a', function () { return view('TeacherShow'); });

我能做什么?

【问题讨论】:

  • 您的 Apache 服务器是否启用了 mod_rewrite?
  • 先生,apache 中的这个 mod_rewrite 在哪里,请发给我路径,从过去 2 天开始,我会非常周到地寻找 iam new here
  • php artisan route:clear 将清除缓存的路由
  • 我曾尝试过多次清除缓存,但

标签: laravel routes


【解决方案1】:

确保启用了重写模块:

sudo a2enmod 重写

确保在编辑配置文件或启用新模块后重新启动 Apache 以使更改生效。

【讨论】:

【解决方案2】:

创建一个名为“.htaccess”的文件并将这些行放在该文件中,然后将该文件放在下面的路径中 “应用程序/公共/”

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L] </IfModule>

【讨论】:

  • 先生,但是在我的 laravel 项目中公共文件夹内已经有一个 .htaccess 文件我可以删除那个
  • 不,只需编辑该文件并将这些代码行放入其中即可。删除之前的代码
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-22
  • 2016-11-15
  • 2017-05-15
  • 1970-01-01
  • 2018-07-31
  • 1970-01-01
相关资源
最近更新 更多