Welcome to WebmasterWorld Guest from 54.145.44.134

Forum Moderators: phranque

Message Too Old, No Replies

Have two domains point to a single site

What are my options?

     

wesg

2:48 am on Feb 1, 2008 (gmt 0)

5+ Year Member



I am in the process of setting up a website for a client, who has purchased two domain names for their website. What are my options to link them together to a single site?

I have read about 301 permanent redirects via .htaccess so that's not really the problem.

Do I need to purchase two separate web hosting services, or can it be done with one package? (ie. if I have space on server A for the main site, do I need server B to contain that single .htaccess file or can I set it up with server A).

Thanks for the help, this forum is a great place for answers.

kbell

4:33 am on Feb 1, 2008 (gmt 0)

5+ Year Member



Just set up domain B as CNAME of domain A and use one host.

coopster

6:26 pm on Feb 1, 2008 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



301 permanent redirects

Just don't forget to incorporate that part!

jtara

7:50 pm on Feb 1, 2008 (gmt 0)

WebmasterWorld Senior Member jtara is a WebmasterWorld Top Contributor of All Time 5+ Year Member



Just set up domain B as CNAME of domain A and use one host.

Not QUITE so simple, but almost so.

You will need to make sure that your hosting plan allows for multiple domains and virtual hosts. Most do, nowadays, at least for 2-3 domains.

With a VPS or dedicated server, of course, generally no problem. You may have to pay for extra IP addresses if you prefer that the sites have seperate IPs, but that wouldn't normally be the case if you are just redirecting and not hosting separate content.

If your host doesn't support this, you have other options. Registrars and third-party DNS providers often offer "forwarding" service, which is often mislabeled as a "DNS" feature. It isn't. They run a web server that does a 301 redirect to your main site. You point the secondary site to their server, and it does the redirects.

Finally, how do you want the URL bar in the browser to read after the user has navigated to the site?

That is, you have:

example2.com -> example.com

If somebody types in [example2.com,...] when they arrive on your site, do you want the URL to read example2 or example?

If you want it to read example2, then you need to set up a virtual host, and just point it to the same content directory on the server. You will also have to make sure all your links in your pages are relative, not absolute.

wesg

8:11 pm on Feb 2, 2008 (gmt 0)

5+ Year Member



I think the only reason is to have people come to the page when they mistype the address. Who knows, maybe they can get by with one domain.

Durham_e

8:31 pm on Feb 6, 2008 (gmt 0)

10+ Year Member



"You will also have to make sure all your links in your pages are relative, not absolute"

Good point Jtara, thanks for such a excellent post to such a common question that has todate for me, never really been fully answered.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month