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

前端 未结 24 1829
灰色年华
灰色年华 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:16

    I've found solution

    I put following code into my public/.htaccess and now its running at rocket speed :D

    
        
            Options -MultiViews -Indexes
        
    
        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]
    
    

提交回复
热议问题