Web Hosting Talk







View Full Version : trouble redirecting domain name to another


canadave
05-02-2010, 09:41 AM
Apologies if this is the wrong forum to post in....I'm having some trouble redirecting a domain name to another, and was wondering if I'm misunderstanding how it should work.

There are two domains in question: privateerdays.ca, and privateerdays.com. For brevity, I'll just refer to them as ".CA" and ".COM" hereafter).

I have both domains registered at Netfirms, and my shared hosting account is at Hawk Host.

.CA is the main actual website that I want people to go to. The Hawk Host account for .CA has all the files, images, etc. The .COM domain, on the other hand, has no content; the only thing I want to have happen when people type .COM into their browsers, is that they get redirected immediately to .CA. All .COM should do in life is exist as a pointer to .CA.

Now, my understanding was that all I'd have to do is set up .COM as a parked domain in Hawk Host's cPanel, set it to redirect to .CA, and that'd be that. However, when I tried that, any time I put in .COM in my browser, it showed me the .CA content, but the address bar showed ".COM".

Next I went to the Netfirms Domain Manager, and set .COM to "forward" to .CA. This seemed like a straightforward setting in that control panel. But again, the same thing--when visiting .COM, the .CA content showed, but with .COM in the address bar.

For now, it's working, because a Hawk Host support guy has set .COM up as an "addon domain", with its own .htaccess file in a separate subfolder doing all the work. But that's a workaround, not a fix. Surely there is a more elegant and simple way to do this using a parked domain or redirect in cPanel, or somehow through the Netfirms Domain Manager control panel?

Thanks for any insight you good folks can provide....I never thought this would be such a complicated thing to do.

canadave
05-02-2010, 11:14 AM
Well, I got it solved, anyway. I changed the nameservers for .COM so that they were the nameservers for Netfirms, rather than Hawk Host. Then I set up .COM to forward without masking to privateerdays.ca.

However, I would've preferred to have .CA and .COM both point to Hawk Host nameservers, and do any necessary redirecting or forwarding for .COM in Hawk Host's cPanel. Is there any way to do that, in a manner that results in the outcome described above?

cagoon
05-02-2010, 11:21 AM
i recommend you stop using your hosts dns and get 3rd party dns like freedns.afraid.org

why? this way you have full control over your domain/email even if your host falls through + 4 dns servers in 4 dcs + you get the forward option that you want

TonyB
05-02-2010, 12:28 PM
A few ways to do this. An add-on domain with a specific redirect is one way to do it probably least confusing for most users. The other ways are parking the domain then doing something like this.

In location the domains are probably public_html you add this to the .htaccess file at the top:


RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.privateerdays\.ca
RewriteRule (.*) http://www.privateerdays.ca/$1 [R=301,L]


What this one does is anything that does not equal www.privateerdays.ca will be redirected to www.privateerdays.ca. This is great if you add more domains later on and don't want to keep adding code.

The other way is if you want to be specific in which case you'd do this I believe:


RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.privateerdays\.com [OR]
RewriteCond %{HTTP_HOST} ^privateerdays\.com
RewriteRule (.*) http://www.privateerdays.ca/$1 [R=301,L]


I haven't tested this one but I believe it's correct. It would redirect www.privateerdays.com or privateerdays.com to www.privateerdays.ca.