没有index.php的情况下路由无法工作
- 论坛
- 没有index.php的情况下路由无法工作
13 浏览
没有index.php的情况下路由无法工作
我正在使用laravel 4。
我有一个视图nest.blade.php
和相应的控制器NestController.php:
控制器内容:
class NestController extends BaseController { public function showView() { return View::make('nest'); } }
路由:
Route::get('/nest', 'NestController@showView');
当我访问url/nest时,它不起作用。
当我访问url/index.php/nest时,它起作用。
显然,我只希望它是/nest而不是index.php。
我该如何解决这个问题?
我的htaccess:
IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]