php - 随机 抱歉,找不到您要找的页面 Laravel 5.5

标签 php laravel error-handling http-status-code-404

我有这个程序运行良好,没有任何错误
并且在随机时间,我得到了这个错误页面。

抱歉,找不到您要查找的页面。

在我尝试访问的任何页面中。此错误会持续几分钟,稍后会自行清除,因为相同的页面会按预期显示。

少数路由代码
Route::get('/', 'indexController@index')->name('index-post-page'); Route::get('/login', 'indexController@login')->name('index-login-page'); Route::get('/post/{post_id}/{title}','indexController@SinglePost')->name('SinglePost-page'); Route::get('/account/contributor/dashboard','indexController@ContributorsDashboard')->name('page-contributor-admin'); Route::prefix('account')->group(function() { Route::get('/', 'indexController@accountDashboard')->name('admin-home-page'); Route::get('/nonadmin', 'indexController@accountDashboardNonAdmin')->name('page-non-admin'); Route::get('/nonadmin', 'indexController@ContributorsDashboard')->name('page-non-admin'); Route::get('/admin/add/category', 'indexController@AddCategory')->name('page.add.category'); Route::get('/admin/view/category', 'indexController@viewCategory')->name('page.load.all.category'); Route::get('/admin/audit/featured', 'indexController@AuditFeatured')->name('page.feature.unfeature.post'); Route::get('/post/notification/data/{contributor_id}', 'indexController@PostNotificationReportData')->name('admin.post.notification.report.data'); })
检查了错误日志,我看到的只是 ERROR 404(找不到页面) - 尽管该页面存在

我想相信这不是程序问题,而是服务器问题,因为我在另一台服务器上托管了相同的脚本并且一切顺利。

但我不知道该告诉服务器管理员什么导致错误或我需要他修复什么。

网址:program link

登录链接:AUTOMATIC_LOGIN

有人可以给我一个提示或究竟是什么导致了这个随机错误 404

最佳答案

确保在您的 apache 配置中,您的 Web 根目录指向公共(public)目录而不是应用程序根目录。

<VirtualHost [2001:db8::a00:20ff:fea7:ccea]:80>
  ServerAdmin webmaster@host.example.com
    DocumentRoot "/www/docs/host.example.com/public"
    ServerName host.example.com
    ErrorLog "logs/host.example.com-error_log"
    TransferLog "logs/host.example.com-access_log"
</VirtualHost>

关于php - 随机 抱歉,找不到您要找的页面 Laravel 5.5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48889850/

相关文章:

PHP:在输出中查找具有相对路径的图像和链接并将它们转换为绝对路径

php - 无法修改标题信息 session Cookie创建吗?

java - Windows CMD 无法调用另一个类

java - spring mvc 验证异常不由 ControllerAdvice 处理

php - session 登录与 HTTP 身份验证。优点缺点

php - 使用 PHP 显示存储在 mySQL 数据库中的图像

php - 在 Drupal 中使用 Apache Solr 按版本索引而不是节点

php - 如何在 phpunit 测试运行时禁用在控制台上显示应用程序日志消息?

php - 无法添加外键

javascript - 保存用户动态添加的字段中的多个输入