wonton
wonton

Reputation: 8247

Laravel Redirect doesn't seem to work

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

return Redirect::to_action('profile');

it brings the user to www.mysite.com/index.php/profile

I've tried it with Redirect::to('profile'); but that doesn't work either. Redirect::home(); brings me to www.mysite.com/index.php which lead me to believe that my mod_rewrite was somehow not working but I have RewriteEngine on

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

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

in the .htaccess under public.

Upvotes: 4

Views: 2470

Answers (1)

Dave S
Dave S

Reputation: 798

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

It's easily overlooked, so make sure you've set 'index' => '', in your application/config/application.php. It's on line 42 in the default config.

Upvotes: 10

Related Questions