2017-03-08 157 views
0

我已經安裝了一個新的流明框架。但它只路由'/'路由。 在其他路由上,它只返回'/'主頁。只有根路由工作[Lumen laravel]

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

web.php是這樣

$app->get('/', function() use ($app) {  return " it is working"; 
}); 

$app->get('hello', function() use ($app) {  return "it is not working"; 
}); 

PS: - AllowOverride設置All在httpd.conf文件。

+0

你能告訴我們你的''web.php''代碼嗎?另外,你正在運行什麼開發設置? '''PHP的工匠服務',宅基地?我們需要更多的信息來幫助你。 – Mark

+0

@Mark我用web.php更新了這個問題,是的,它是宅基地開發。 –

+0

@Mark問題只與流明5.4,與5.3和5.2 ..很好地工作! –

回答

0

這說明你已經在你的.htaccess文件沒有問題, 也許你正在使用PHP下面5.5.9, 嘗試用最新的更新

vagrant box update 

之前更新您的流浪漢箱這樣做,備份您現有的文件

或者你可以查看official docs關於如何做我t