lundi 28 octobre 2019

Heroku website deployment error: "Forbidden You don't have permission to access this resource."

I'm deploying my Laravel website to Heroku where I am getting a Forbidden You don't have permission to access this resource. error as soon as I visit my deployed website.

Here is an image showing the error:

I have tried changing the permission of my Laravel root folder using the: chown -R 777 command to change the permissions for every user to be able to read and write, with the hope to work, but it didn't. Next, i tried changing the permissions from the .htaccess file by writing Require all granted which also didn't work unfortunately.

For more information, here is my .htaccess file

Require all granted

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

php_value upload_max_filesize=32M
php_value post_max_size=32M
php_value max_execution_time 300
php_value max_input_time 300

When I visit the domain, the website should be displayed. I also tried to deploy more Laravel applications with the hope to see whether they would work, but still I get the same Permission issue.



via Chebli Mohamed

2 commentaires:

Unknown a dit…

Make sure you have a file name "Profile" with the P in uppercase

Unknown a dit…

and inside you get this code line : web: vendor/bin/heroku-php-apache2 public/

Enregistrer un commentaire