簡體   English   中英

Laravel Redirect似乎不起作用

[英]Laravel Redirect doesn't seem to work

當我從www.mysite.com/login的控制器運行時

return Redirect::to_action('profile');

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

我用Redirect :: to('profile')嘗試過它; 但這也不起作用。 重定向::家(); 帶我到www.mysite.com/index.php,讓我相信我的mod_rewrite不知何故不起作用,但我有RewriteEngine on

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

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

在公共場合的.htaccess。

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

它很容易被忽略,所以請確保在application/config/application.php設置'index' => '', 它位於默認配置的第42行。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM