這裏是我的路由代碼:流明路由不起作用
$app->get('/foo', function() {
return 'Hello World';
});
$app->get('/', function(){
return 'asd';
});
的問題是,我總是得到「ASD」頁面上,即使我參觀了一些隨機的路線,這不存在。所以如果我訪問localhost/sadgasgasdgsa,我會在頁面上看到'asd'。當我訪問localhost/foo時,我也會收到'asd',即時'Hello World'。任何想法我的問題是什麼?
注: 這似乎是同樣的問題: Lumen routes not working other than '/' route 但是沒有人回答了這個問題。我的服務器確認簡單的WAMP,PHP 7,apache2和mysql。雖然尋找解決辦法,我增加了以下.htaccess文件:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
但是它不工作 EDIT 對於那些誰來到這裏與搜索引擎,我已經下分級流明的版本,並開始工作。