Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.

share|improve this question

migrated from superuser.com Aug 23 '12 at 13:47

This question came from our site for computer enthusiasts and power users.

2 Answers 2

up vote 5 down vote accepted

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.

share|improve this answer
    
I am Using a Shared hosting and I do not have access to the apache files, I just have access to 'www' directory. But still how can I setup a Virtual Server or is there any other way to do this? –  Akshat Mittal Aug 25 '12 at 6:14
    
The issue you're going to run into is that the web server for maindom.com has no idea how to handle secdom.com as there's nothing in it's configuration that tells it what to do with that site. You could either send in a ticket to your shared hosting provider and see if they'd add a config to their web server for the domain, setup URL forwarding for the domain if your registrar supports it, or add hosting service for the secdom.com domain and redirect everything to maindom.com. –  bobmagoo Aug 25 '12 at 13:02

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.

share|improve this answer
    
This seams to me like 'Parking' a Domain to another. I don't/can't do that. Can you tell me a manual way of doing this. –  Akshat Mittal Aug 23 '12 at 13:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.