Mobile app version of vmapp.org
Login or Join
Pope3001725

: Domain Redirect to another using CNAME Record I have a Domain, lets say maindom.com, now I want to have another Domain, lets say secdom.com to point to maindom.com such that all the URL's leads

@Pope3001725

Posted in: #Cname #Dns

I have a Domain, lets say maindom.com, now I want to have another Domain, lets say secdom.com to point to maindom.com such that all the URL's leads to maindom.com. I want to do this with the help of CNAME records only. I can use third-party services also.

Example:
secdom.com/rand123 Leads to maindom.com/rand123
secdom.com/ano2484/anot Leads to maindom.com/ano2484/anot
secdom.com/tesecqz?id=45 Leads to maindom.com/tesecqz?id=45

I tried adding a CNAME record to secdom.com with value maindom.com, but just din't work.
Another point to note is that the IP of maindom.com host other websites also and not just this one, this can be a problem I guess.

How to do this? Any help is appreciated.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Pope3001725

2 Comments

Sorted by latest first Latest Oldest Best

 

@Tiffany637

The DNS setup you configured basically tells users that the site secdom.com is hosted at maindom.com's IP address. Unless you tell the webserver on maindom to accept requests for secdom (by adding a VirtualHost for example), the maindom webserver isn't going to know how to serve up the content for secdom.

If you know what web server you're running on maindom, you can configure it to accept requests for secdom and forward them on to the maindom. For example, on Apache, you could configure a VirtualHost for secdom on maindom and redirect all traffic to it by using .htaccess redirects.

10% popularity Vote Up Vote Down


 

@LarsenBagley505

As well as adding a CNAME for secdom, you need to add the hostname to the webserver hosting maindom so it knows to respond to requests from secdom. Ask your host - they should be able to do this easily.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme