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

https redirect

From the controller, to make a redirect i would : php $this->response->redirect('login/index'); If i am on HTTP, redirect will stay on HTTP.

Is there an easy way to redirect to a HTTPS link , without having to provide the hostname ? ( we have devel-host ,staging,live )

I don't think there is. If you're redirecting to https from http, I believe you need the whole URL. However, that doesn't need to be hardcoded - you can pull that from $_SERVER



26.3k

@alexconrad Hi! Did you solved your problem? Could you tell how? I mean, what the best practice is? :)



26.3k

@alexconrad Could you look at my post here and evaluate my solution? Could you provide the one you have choosen? ;> Thanks!

A link: https://forum.phalcon.io/discussion/2655/force-https-#C13522