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 ^(.*) http://www.satepadang.com$1 permanent;
}

In Apache try this:

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

This forum is about phalcon, not about apache or nginx