2012-09-21 106 views
4

當我從控制器運行www.mysite.com/loginLaravel重定向似乎並沒有工作

return Redirect::to_action('profile'); 

它帶給用戶www.mysite.com/index.php/profile

我試過用Redirect :: to('profile');但那也行不通。 重定向:: home();使我www.mysite.com/index.php導致我相信我的mod_rewrite不知何故沒有工作,但我有在公衆

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteRule ^(.*)$ index.php/$1 [L] 

在.htaccess RewriteEngine敘述。

回答

10

對於Laravel生成鏈接減去index.php前綴,除了具有.htaccess文件外,還需要正確配置它。

很容易被忽視,因此請確保您在application/config/application.php中設置了'index' => '',。它在默認配置中位於第42行。