$url = $_SERVER["SERVER_NAME"]; $subdomain = substr($url,0,strpos($url,".")); if($subdomain == "bollden") { header("Location: http://www.".$url); } else { header("Location: http://".$url."/".$subdomain."/"); } echo "