I've got a domain lets say it's domain.com. This domain goes to a server with apache on this server I'm running three sites for that domain which are:
domain.com (default) dev.domain.com mail.domain.com
Each of those domains got a directory in my ~/public-www/ folder with the same name.
I want www.domain.com to redirect me to domain.com, I want development.domain.com to redirect me to dev.domain.com, I want email.domain.com and epost.domain.com to redirect me to mail.domain.com and I want all other subdomains to redirect me to the default domain.com site.
How should I config my apache2 sites in order to work like that and to do proper redirections. Someone told me that for searchengines to index and rank my sites properly the redirection have to be done with a 301 redirection or something like that.