Link_to Subdomain and the Opposite

http://agilewebdevelopment.com/plugins/url_for_domain

Best regards

Peter De Berdt