我已经上传了我的拉拉项目共享托管和我的图像将无法工作。
我在根目录中添加了.htaccess,除了图像之外,所有东西都可以工作。我的.htaccess文件在下面。
RewriteEngine On
RewriteBase /
RewriteRule ^$ public/index.php [L]
RewriteRule ^((?!public/).*)$ public/$1 [L,NC]我的图像链接是mydomain.com/storage/facilities/May2017/BYKdbdIQCezQ6Gsh05EK.jpg
它显示您没有访问此服务器上的/public/storage/facilities/May2017/BYKdbdIQCezQ6Gsh05EK.jpg的权限。403错误是这个符号链接错误吗?我没有ssh访问权限,所以有任何方法链接存储文件夹吗?
发布于 2017-06-29 15:55:03
下面是简单的解决方案,您可以使用cron作业创建符号链接,您必须做的是。
( 1) php (通往技工的绝对路径)存储:链接
类似php /home/(yourusername)/public_html/artisan存储:link
或
2) /home/(yourusername)/public_html/storage/app/public/ / -s /(Yourusername)/-s_html/public
转到公用文件夹并将public重命名为存储。
发布于 2017-06-29 15:18:04
有两件事:
1)我建议您将图像放在“资产”文件夹中
2)众所周知,Laravel不喜欢你访问存储文件夹。如果需要的话,您可以更改它的权限,但我强烈建议您在决定将其设置为什么之前,先知道您在做什么。
https://stackoverflow.com/questions/44829003
复制相似问题