【问题标题】:Can't access Laravel /public anymore. Laravel handles it as a route.无法再访问 Laravel /public。 Laravel 将其作为路由处理。
【发布时间】:2017-01-12 18:16:32
【问题描述】:

在 DirectAdmin 中,我更改了项目的域名。但不幸的是,它没有给我想要的结果。所以我撤消了我的行动。但是,这并没有解决问题。

起初,我能够访问我的 site.com/public 文件夹以将资产用于我的网站。但是在我失败之后,Laravel 将 /public 目录作为路由处理。因此,我无法再访问我的公用文件夹和所需资产。

我的域名:good2beout.nl

谁能帮帮我?

附:我已经看过问题Laravel 4 - public directory being treated as a route - image not showing 但这并不能解决我的问题。

【问题讨论】:

  • 您是否更新了 .env 文件中的 APP_URL?
  • @FelippeDuarte 我的 .env 文件中没有 APP_URL
  • 在你的 config/app.php 中,你有一个 'url' 键吗?尝试更新该信息。
  • 在我的 config/app.php 我有 'url' => 'good2beout.nl',(看起来不错,我认为)

标签: php laravel-5.3


【解决方案1】:

我发现了我的问题。

我不小心覆盖了我的 .htaccess 文件,将其替换为

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

https://laravel.com/docs/4.2#pretty-urls

【讨论】:

    猜你喜欢
    • 2023-03-30
    • 2014-11-25
    • 2014-06-25
    • 2017-05-13
    • 2017-03-02
    • 2015-11-17
    • 1970-01-01
    • 2019-05-07
    • 2017-10-24
    相关资源
    最近更新 更多