Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dbernie41

macrumors regular
Original poster
Nov 14, 2007
136
47
Ohio
So I have a website (domain and hosting) that I am going to be developing. There is a similiar domain name that I have decided to purchase and I want it it to automatically re-direct to the first site. Is this something I set up when I purchase the 2nd domain or where do I take care of this?
 
The specific way you do it generally depends on your domain registrar, but it's generally done through them. Just have it point to the correct IP.
 
If the web host there says its up to you, and you happen to be running a VPS, there is a setup in most control panels called Domain Forwarding, and it's very straight forward. If it happens to be Apache, you can also simply turn on the rewrite engine and create a .htaccess in your document root as follows:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^fwdfromdomain\.com
RewriteRule ^(.*)$ http://www.fwdtodomain.com/$1 [R=permanent,L]

Just thought I'd cover the manual ways of doing this, short of adding in meta-refresh or javascript redirects which aren't as efficient. With the .htaccess method you can also change the rewrite condition to use regular expression matches to forward specific URL's and/or keep arguments intact between both domains, hence the advantage.

-jim
 
Don't have 2 domains with the same content

You really shouldn't allow the same content to be displayed on different domains. It will hurt your search rankings, you must do an HTTP redirect to the domain you want really to be used.
 
None of the suggestions thus far involve mirroring or copying content between two sites. The solutions suggested simply redirect as you noted.
Jim, your solution indeed provides a redirect to the single URL serving the site hence changing the URL in the browser if is not *that* URL. So all is well.

However, just pointing the "A" entry for both domains to the same IP could serve the same content with two different URLs if you are not using virtual hosting (or doing it cleverly). Hence my reply.
 
Some people run their own nameservers and VPS's which allow virtual name hosting on the same machine. I happen to be one of those people. But I agree completely with what you noted, btw. I don't recall anyone mentioning A records, but it is Friday, I'm tired and apologize if I misunderstood ya in any way!

-jim
 
I run multiple sites on the same server too :)

So we're both saying the same thing, just a little misunderstanding.
My remark was building upon angelwatt's answer. He said to just point the domain to the same IP. I wanted to make it clear that doing so is a lot better using redirections as you mentionned.

Cheers!
 
I run multiple sites on the same server too :)

So we're both saying the same thing, just a little misunderstanding.
My remark was building upon angelwatt's answer. He said to just point the domain to the same IP. I wanted to make it clear that doing so is a lot better using redirections as you mentionned.

Cheers!

Thanks for clarifying for me, I am tracking now.

-jim
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.