Awar Pulldozer
Awar Pulldozer

Reputation: 1101

Laravel 403 Forbidden Error after host move

I have a Laravel 5.7 project working fine, but I changed the host and i got this error:

Laravel 403 Forbidden Error

I updated the .htaccess file with this code:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^$ public/ [L]
    RewriteRule (.*) public/$1 [L]
</IfModule>

but I still get the error.

Upvotes: 1

Views: 795

Answers (3)

L&#237;via Gomes
L&#237;via Gomes

Reputation: 46

I had the same problem, what I did to fix this was to change permissions on the root folder of the project from 0644 to 0755.

Upvotes: 1

Udhav Sarvaiya
Udhav Sarvaiya

Reputation: 10061

Inside your .htaccess change to this:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule> 

Upvotes: 4

BastienCtr
BastienCtr

Reputation: 329

You should try

chown -R www-data:www-data .

within your website folder

Upvotes: 2

Related Questions