Laravel Redirect not working

When I run from the controller for www.mysite.com/login

return Redirect::to_action('profile'); 

it displays the user at www.mysite.com/index.php/profile

I tried it with Redirect :: to ('profile'); but it doesn’t work either. Redirection :: house (); leads me to www.mysite.com/index.php, which made me believe that my mod_rewrite somehow didn’t work, but I have RewriteEngine on

  RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] 

in .htaccess under general.

+4
source share
1 answer

For Laravel to create links minus the index.php prefix, you need to configure it correctly, in addition to the .htaccess file.

This is easy to miss, so make sure you set 'index' => '', to application/config/application.php . It is on line 42 in the default configuration.

+10
source

Source: https://habr.com/ru/post/1435438/


All Articles