Handle subdomains and domains