if (isset($_SERVER['HTTP_ACCEPT']) && preg_match("/vnd.wap.wml/", $_SERVER['HTTP_ACCEPT'])) {
    header('Location: http://wap.site.com/');
    exit;
}