Added support for multiple domains and subdomains