在本地使用php artisan serve
一切正常,但在服务器上除了/
之外的所有路径都没有找到。
我认为这与配置有关,但不确定从哪里开始。我怎样才能使这些路线正常运行呢?
Edit: my routes
// works
Route::get('/', 'HomeController@showWelcome');
// 404
Route::get('/map', 'HomeController@showMap');
// 404
Route::get('/assets/{filename}', 'HomeController@getAsset');
很可能你没有设置你的web服务器将所有请求重定向到Laravel。
http://laravel.com/docs/installation pretty-urls
Apache:Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
nginx的:
location / {
try_files $uri $uri/ /index.php?$query_string;
}