We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Redirect to root [SOLVED]

Hello, I want to redirect to mysite.com/ but all I get to do when I redirect is get to mysite.com/index. How can I make it appear the way I want?

return $this->response->redirect('index');

Thanks so much.



39.3k
Accepted
answer

Try this

return $this->response->redirect('');


18.9k

It works! Thanks Nicolaos! :D

edited Oct '14

You can also do

$this->response->redirect();

But I cant figure out why

$this->response->redirect('/');

doesnt work ;(



18.9k
edited Oct '14

Yes SneakyBobito, I also thought that

$this->response->redirect('/'); 

would take me to the root. Thanks!