Fixes issue #491

This fixes issue #491

I would add a unit test for this, but, I'm not sure how I would test two separate domains since that's linked to server config.