公用文件夹中的文件不显示[Laravel]

问题描述 投票:0回答:3

我有一个正在生产中的网站,无法访问public / css中的某些文件夹。我检查了所有文件夹的权限,检查了公共文件夹中的.htaccess,我找不到为什么某些文件夹显示在本地版本Local中而不显示在生产版本Prod中的原因。

例如为此:

<link rel="stylesheet" href="{{ asset('css/directives/gallery.css') }}"/>

在我的本地版本中,它可以工作,因为显示了文件夹指令,但是在生产中出现404错误。

Failed to load resource: the server responded with a status of 404 (Not Found)

这是在生产服务器Production Files和内部directives上的外观>

该网站是使用Laravel 5.4用PHP编写的,下面是我的生产中的.htaccess文件,它与我的本地版本相同。

感谢

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>
    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

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

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

我有一个正在生产中的网站,无法访问public / css中的某些文件夹。我检查了所有文件夹的权限,检查了公共文件夹中的.htaccess,找不到某些文件夹的原因...

php laravel .htaccess public
3个回答
0
投票

将所有权限授予公用文件夹chmod -R 777 public


0
投票

所有者和“指令”目录的组与其他目录中的相同吗?


0
投票

可以使用以下内容,它将资产方法与公用文件夹路径结合在一起。

© www.soinside.com 2019 - 2024. All rights reserved.