Using wildcard dns and redirects
I've been using this for a long time, but I'm wondering about whether something is possible.. I've tried a couple of things but none of them really work out, noone who I've asked knew the answer either.I've got two domains, I'll call them domain.com and domain.net for now. I've setup wildcard dns to accept *.domain.net and to redirect this (in httpd.conf) to http://www.domain.com which all works fine, using these lines in the virtualhost:
ServerAlias *.domain.net domain.net
RedirectMatch 301 (.*) http://www.domain.com$1
It all works perfect, that's not the issue.
The thing is, it will redirect anything.domain.net to www.domain.com, and I want it to redirect anything.domain.net to anything.domain.com
I've tried many different things but it doesn't really seem to work out. By the way: this isn't important at all, I'm just testing around, but I'm wondering whether there's anyone who knows how to make it work the way I described.