简体   繁体   English

Laravel 403 Forbidden:您无权在生产环境中访问此服务器上的/index.html

[英]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.

相关问题 Laravel Forbidden 您无权访问此服务器上的 /storage/ - Laravel Forbidden You don't have permission to access /storage/ on this server 403 Forbidden 您无权访问此资源 - 403 Forbidden You don't have permission to access this resource (403) 禁止。 您无权访问此资源 - (403) Forbidden. You don't have permission to access this resource 403禁止访问:您无权访问 - 403 Forbidden : You don't have permission to access 403 Forbidden:您无权在wordpress中访问 - 403 Forbidden : You don't have permission to access in wordpress 403 Forbidden:您无权访问Codeigniter - 403 Forbidden : You don't have permission to access in Codeigniter Laravel 收到 403 Forbidden 错误“您无权访问此资源。” - Laravel getting 403 Forbidden error “You don't have permission to access this resource.” OS X(10.9.1)本地主机403禁止您无权访问此服务器上的/ - OS X (10.9.1) localhost 403 Forbidden you don't have permission to access / on this server Symfony app 403禁止错误:您无权访问此服务器上的/ - Symfony app 403 Forbidden error: You don't have permission to access / on this server Heroku 上的 Symfony:403 Forbidden 您无权访问 / 在此服务器上 - Symfony on Heroku: 403 Forbidden You don't have permission to access / on this server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM