[英]Laravel 403 Forbidden: You don't have permission to access /index.html on this server in production
I am having a problem with a website in production. 我在生产中的网站有问题。 I have been working on this website in a sub-to-dir and have now placed the project on the true website.
我一直在该网站的子目录下工作,现在将项目放置在真实的网站上。 But now I keep getting this:
但是现在我继续得到这个:
403 Forbidden
You don't have permission to access /index.html on this server.
The website doesn't give this error on the sub-to-dir version. 网站未在子目录版本中显示此错误。 The .htaccess file which I am using in my root:
我在根目录中使用的.htaccess文件:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
Can someone explain to me what I am missing? 有人可以向我解释我所缺少的吗? I have changed the
server.php
to index.php
and back but that also doesn't make a difference. 我已经将
server.php
更改为index.php
并返回,但这也没有任何区别。 I have also tried giving all files and folder 777 permission but no luck. 我也尝试给所有文件和文件夹777授予权限,但没有运气。
edit the file /etc/apache2/apache2.conf
编辑文件
/etc/apache2/apache2.conf
<Directory /var/www/yourlaravelapp/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
and sudo a2enmod rewrite
and restart apache, that may work for you. 和
sudo a2enmod rewrite
并重新启动apache,这可能适合您。
只需重新授予权限sudo chmod -R 777 /path/to/index.html file /
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.