if(!stristr($_SERVER["SERVER_NAME"],"www.")){
     header('Location: http://www.'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
}
Yardımcı Olacağını Düşünüyorum.