fixed subdomain parsing and redirection