【发布时间】:2018-08-14 09:05:08
【问题描述】:
我有两个域。假设 reports.test.com 和 report.test.com 指向一个 Laravel 5.0 应用程序。有时在我的日志文件中,它显示NotFoundHttpException in RouteCollection.php line 145: 错误。 为什么我的应用程序会记录 NotFoundHttpException?
这些是我的日志文件的位置
http://reports.test.com/storage/logs/laravel-2018-08-13.log
http://report.test.com/storage/logs/laravel-2018-08-13.log
【问题讨论】:
-
什么意思?当您向 report.test.com 发出 http 请求时,http 响应为 404 ?
-
有时 report.test.com 正在工作,而此时 reports.test.com 不工作,反之亦然
-
看,这真的是网络服务器的问题,而不是你的后端(laravel),当请求到达网络服务器时它会触发 laravel,laravel 做出响应并提供给网络服务器和网络服务器给它回客户端。所以请确保对于这两个域,请求都来自您的 laravel 应用程序。在你的 public/index.php 文件中做一个 die('executed') 并请求你的两个域并检查请求是否到达 laravel。
-
您能否提供有关您的安装的更多详细信息?你用什么作为你的网络服务器?详细说明您的设置,以便我们更好地为您提供帮助。你能说明这个异常是在哪条路由上启动的吗?
-
访问者访问的网址不再属于您的网站。