Laravel - Forbidden You don't have permission to access / on this server

前端 未结 24 1942
灰色年华
灰色年华 2020-11-30 02:02

My laravel installation was working fine yesterday but today I get the following error:

Forbidden

You don\'t have permission to access / on this server.

Ad         


        
24条回答
  •  感情败类
    2020-11-30 02:22

    On public/.htaccess edit to

    
     
                  Options -MultiViews
              
    
              RewriteEngine On
    
              # 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]
    
              # Handle Authorization Header
              RewriteCond %{HTTP:Authorization} .
              RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
    

    In the root of the project add file

    Procfile
    

    File content

    web: vendor/bin/heroku-php-apache2 public/
    

    Reload the project to Heroku

    bash
    heroku login
    cd my-project/
    git init
    heroku git:remote -a my project
    git add .
    git commit -am "make it better"
    git push heroku master
    heroku open
    

提交回复
热议问题