How can I fix Laravel 5.1 - 404 Not Found?

前端 未结 6 1352
小鲜肉
小鲜肉 2020-12-29 11:30

I am trying to use Laravel 5.1 for the first time. I was able to install it and https://sub.example.com/laravel/public/ is displaying what is should. However, v

6条回答
  •  天涯浪人
    2020-12-29 12:03

    if its on a live server, try this, it worked for me tho.

    
    
        Options -MultiViews -Indexes
    
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    
    
    # 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]
    

提交回复
热议问题