My wee brain is refusing to help me this morning

I'm beginning to host my sites on a specific domain (example.com), so the site website1.com actually lives at
example.com/~website1/ or
website1.example.com
What I'd like to do is block traffic that is visiting either of the
example.com addresses, other than the properly domain
website1.com - I'm thinking .htaccess?
Any ideas?