我一直在这个问题上花费数小时,希望找到出路.我已经正确设置了laravel,创建了一个项目myapp
Route::get('/',function() { return View::make('hello'); }); Route::get('/users',function() { return 'Users!'; });
我跑的时候
http://localhost/myapp/public/
我正确地得到了laravel启动页面
我跑的时候
http://localhost/myapp/public/users
我明白了
The requested URL /myapp/index.PHP was not found on this server.
我不知道为什么它在寻找index.PHP.
我跑的时候
http://localhost/myapp/public/index.PHP/users
http://localhost/myapp/public/users
代替.
下面是我的.htaccess
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On Rewritebase /myapp/ # Redirect Trailing Slashes... RewriteRule ^(.*)/$/$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.PHP [L] </IfModule>
有任何想法吗?我在Linux上运行Apache.