Implement subdomain handling for extension

Signed-off-by: crynobone <crynobone@gmail.com>