2017-02-24 69 views
0

我在laravel 5.3上創建管理員面板。我嘗試安裝睡衣4.根據官方文檔製作的所有項目。所有項目按預期運行(http://blog.laravel/)。但是......如果我去比Apache問題的鏈接不要在laravel5.3的項目中工作管理員面板和授權

http://blog.laravel/admin 

Not Found 

The requested URL /admin was not found on this server. 

後,我嘗試使用授權。我製作了一個名爲「auth」的新項目。但是......如果我去的鏈接:

http://auth/signup 

Apache問題太...:

Not Found 

The requested URL /signup was not found on this server. 

所有權利是開放的寫改寫。我所有的步驟根據這些文件:

https://laravel.com/docs/5.3/installation 

我不知道我做錯了什麼。請告訴我,我該怎麼辦

有github上的鏈接:

https://github.com/AlexBukreyev/blog.laravel - this is my project, where I make admin-panel. 

https://github.com/AlexBukreyev/auth - this is project of authorization 

file public /.htaccess: 

<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> 

回答

0

原來,它是在Apache的設置!你需要通過控制檯連接mod_rewrite:

apache2ctl -M | grep -i rew 
    sudo a2enmod rewrite 
    sudo /etc/init.d/apache2 restart 
1

確保在public目錄中,有一個名爲.htaccess文件(用點在開始時)。該文件的內容應該是這樣的:

<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> 
+0

Eddy,這個文件.htaccess在這裏。 –