4

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?

3
  • 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, 2012 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, 2012 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 ;)
    – iammichiel
    Jan 24, 2012 at 21:57

2 Answers 2

5

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.

1
  • 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, 2012 at 12:56
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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