Domain A to B routing

27 Views Asked by At

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?

1

There are 1 best solutions below

0
baterja On

If you need exactly

B.example/XYZ -> to point -> AAAAAAAA.example/?param=XYZ

redirect then it's necessary to use HTTP redirect, so you'll have to host something at the address pointed by the B.com DNS A record that will respond with 30x HTTP redirect response. Because it needs to re-map the HTTP path (/XYZ to /?param=XYZ).

If B.example/XYZ -> AAAAAAAA.example/XYZ would 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.example should be possible with only DNS CNAME records if it's OK for you.