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 first domain name registered with some domain name registrar, for which I don't have web hosting account, only dns hosting.

I have second domain name registered with godaddy, with web hosting account.

I want to redirect the first domain name to the second one so that when the user types the first domain name, what is displayed is the contents of the second domain name, but URL displays first domain name. So for example if I type "firstdomain.com/smth/index.html" it will show me contents of "seconddomain.com/smth/index.html", but URL bar will show "firstdomain.com/smth/index.html".

I tried to do this by setting CNAME on the first domain like this "firstdomain.com -> seconddomain.com", but it seems that it is impossible to set a CNAME record that starts with the first domain name, and points to the second. You can only set up CNAME records that start with subdomains of the first domain. So I can make "www.firstname.com -> seconddomain.com" but not "firstdomain.com -> seconddomain.com". How can I solve this problem?

And after I set up the CNAME for the first domain, what do I need to change in my godaddy account so that everything works as intended? Do I need to change something in the dns records for the second domain as well?

share|improve this question
    
What's the first registrar? Specific information is going to require knowing who you're dealing with. Alternately, check if the registrar offers "domain masking" as opposed to just forwarding. –  Su' Jan 21 '12 at 10:19
    
@Su' First registrar is Japanese, so there is probably no point of mentioning it. I am not sure what is domain masking but I have full control over dns records. –  Sunny88 Jan 21 '12 at 10:35
1  
Let's add, this is not a good practice. Better use one domaine and redirect all other domains toward one main domain. Google likes that better ;) –  Zenklys Jan 24 '12 at 21:57

2 Answers 2

up vote 4 down vote accepted

You don't have to set a CNAME. You could just set an A record pointing to the same IP address. In the hosting panel of your website you have then set the second domain as an alias.

share|improve this answer
    
Thanks, I did as you said and it worked. –  Sunny88 Jan 21 '12 at 11:45
    
Thank you. An upvote would be nice too :) –  Raffael Luthiger Jan 21 '12 at 12:23
    
I wanted to upvote, but I can't, I don't have enough karma for that. You need at least 15 karma in order to be able to upvote. –  Sunny88 Jan 21 '12 at 12:56

A redirect is by definition is a "redirect" and will change the url in the address bar. What you are looking is URL rewriting.

For example Apache supports this kind of thing with mod_rewrite.

share|improve this answer

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.