First, yeah, I know, this question is probably a duplicate, but I've searched for some hours now and I can't find any relevant answer.... So I try asking.
I got, let's say, domain-a.com & domain-b.com. domain-a is just an alias of domain-b.com, and everything (root & subdomains) should redirect to it. So I'd like the following redirections:
http://domain-a.com => http://domain-b.com
http://aze.domain-a.com => http://aze.domain-b.com
http://www.domain-a.com => http://www.domain-b.com
I need also the browser to display domain-b.com
, so domain-a.com
should never appear anywhere when accessing the domain name...
Ok, so far, yeah, that's pretty easy using A-records & redirections using nginx or Apache. But I'd like to do all of this using only my DNS settings (through the OVH pannel), so I'll just have to handle domain-b.com
on my own server.
What I've tried:
- using a CNAME record like this on
domain-a.com
:* IN CNAME domain-b.com.
, but when I go toaze.domain-a.com
, the URL is not changed, and the root domain is not handled. - using 301 redirections, but I have to configure every subdomains, and I don't know which subdomains will be used in advance.
It seems that DNAME record is appropriated to my needs, but I can't set up one with OVH. So, if this is the right record to use, I'll have to transfer my domain to another registrar, so I prefer being sure before doing that.
I got another constraint: my server handles several domain names, so I can't catch every requests to redirect to domain-b.com
equivalent, and I'd like to configure only domain-a.com
.
So, is that possible ?
Thank you for your help