0
我無法設置.htpasswd保護的laravel項目。Laravel 5.2 - 使用.htpasswd的基本身份驗證
我嘗試添加以下到我的.htaccess但它會導致內部服務器錯誤(500)後,我進入了我的憑據..
的.htaccess內容:
AuthUserFile .htpasswd
AuthType Basic
AuthName "Secured area"
Require valid-user
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
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}]
</IfModule>
這是當前routes.php文件。萬一它的東西,我應該在routes.php文件更改:
Route::get('/', '[email protected]');
Route::auth();
Route::get('/home', '[email protected]');
我無法找到任何關於谷歌有用這下laravel 5.2仍然有效,所以我真的希望有人在那裏有一個想法:)
htpasswd發生內部服務器錯誤,請參閱http://stackoverflow.com/q/15476252/1741542 –