2015-09-05 167 views
0

當我打開家裏網址:http://localhost/laravel/public/它重定向我http://localhost/public,給我Laravel首頁url無法正常工作?

錯誤404

.htaccess文件是默認之一,它用於完美,我不不知道哪裏出了問題?

這裏是的.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] 

+0

你應該發佈y我們的htaccess文件 – user2479930

+0

@JoachimMartinsen我的默認Laravel .htaccess –

+0

你運行什麼web服務器? – user2479930

回答

0

嘗試添加RewriteBasehtaccess文件

<IfModule mod_rewrite.c> 
<IfModule mod_negotiation.c> 
    Options -MultiViews 
</IfModule> 

RewriteEngine On 
RewriteBase /laravel/public/ 

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)/$ /$1 [L,R=301] 

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule^index.php [L] 
0

嘗試使用下面的.htaccess文件:

<IfModule mod_rewrite.c> 
    <IfModule mod_negotiation.c> 
     Options -MultiViews 
    </IfModule> 

    RewriteEngine On 

    # Handle Front Controller... 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteRule^index.php [L] 
</IfModule> 
+0

不,它給了我相同的結果 –