Click Here to see code

NOTE: This also works for domains, not just subdomains.