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

Phalcon response redirect appending current controller name - 1.3.2

My current controller is lets say ContactsController (indexAction) . So my URL is https://localhost/myapp/contacts

I want to redirect to Dashboard(indexAction). So I am using the below code:

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

The problem is it is redirecting but it is appeding the current controller name like:

redirecting to---> https://localhost/myapp/contacts/dashboard

My Phalcon version 1.3.2.. it is not seen in 2.0 version But my production is 1.3.2 only

I just updated it to 2.0.8 and it is still having the same problem. But in my local it is working. Can anyone point out what I am doing wrong here?

edited Dec '15

Try redirecting to:

return $this->response->redirect(array(
    'for'=>'index',
    'controller'=>'dashboard'
));

https://docs.phalcon.io/pl/latest/reference/response.html#making-redirections