php - 公共文件夹中的文件不显示 [Laravel]
问题描述
我有一个生产中的网站无法访问 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和内部指令上的外观
网站是使用 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>
解决方案
授予公共文件夹的所有权限 chmod -R 777 public
推荐阅读
- python - 如何使用网络摄像头捕获图像并使用 python 提取图像信息?
- javascript - 调整大小时 Chart.js 模糊
- javascript - Express.js/while-else 循环重定向问题
- python - 保存期间视图集中模型的自动增量字段
- flutter - Skipped x frames! The application may be doing too much work on its main thread. What does this error signify and how to solve this?
- java - Absence of toMap method with key, value and map supplier in Collectors
- vim - 如果 Vim 中有多个空间,则渲染空间
- ios - How to send voip push notification from node js? I can send voip push from curl but not node
- python - Unable to install NLTK with Python 3.7
- java - reuse same class in different class hierarchies