I have a domain named AAAAAAAA.example and I built my site there. The domain name is long. I wanted to have a second site B.example where I would like B.example/XYZ -> to point -> AAAAAAAA.example/?param=XYZ so that I offer less typing for my customers.
What is the easiest and efficient way to achieve this?
If you need exactly
redirect then it's necessary to use HTTP redirect, so you'll have to host something at the address pointed by the
B.comDNS A record that will respond with 30x HTTP redirect response. Because it needs to re-map the HTTP path (/XYZto/?param=XYZ).If
B.example/XYZ->AAAAAAAA.example/XYZwould be enough then you can duplicate DNS records of B and AAAAAAAA domains to point to the same address and you're done. Also, make sure that the app will accept both domain names.Another option
XYZ.B.example->AAAAAAAA.exampleshould be possible with only DNS CNAME records if it's OK for you.