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

Best Way Redirect for WWW

I am new in Phalcon.. I have tried to find the Best Way to Redirect for WWW but still failed... Is there anyone who can help me..?

use $this->response->redirect() ?

or you mean redirect like example.com --> www.example.com?

edited Jul '14

Yes, I mean from example.com to www.example.com in htaccess

edited Jul '14

I don't know about apache. But in nginx, I usually do it this way:

server {
    server_name satepadang.com;
    rewrite ^(.*) https://www.satepadang.com$1 permanent;
}

In Apache try this:

Redirect permanent / https://www.example.com/

This forum is about phalcon, not about apache or nginx