Environment folder not domain specific

Can I make an environment folder that is based only on the end part domain of the environment? So currently my dev domain is test.dev and if i put that live it would be test.com - so my env folder names are based on that - but I want to have the folders just named the ending part of the domain - so a folder called *.dev and a folder called *.com or whatever for settings etc that will be the same on all my websites?