PDA

View Full Version : Domains and Forwarding



spacious
04-27-2008, 05:52 PM
First let me say the best thing about WS is the forum.
The help here is fantastic.

Second let me apologize if this has been covered in another thread, I have done my due diligence in searching, but have not found anyone w/ this specific issue.

I have a reseller account, all of which are 3.0 now.

I am retiring an old domain (domain1.com) and want all the traffic and email to go to a new domain (domain2.com)... easy enough right?

Well, here's the issue:

I want all requests for domain1.com to FORWARD to domain2.com, so domain1.com/path/to/happiness becomes domain2.com/path/to/happiness.

I could forward from my registrar but then the mail doesn't get through (w/o screwing with MX records). If I just add the domain to my account and set it's path to the web root (so the email will automatically go through), the domain name does not change.(it stays domain1.com/path/to/happiness, which is not all that happy)

I basically am trying to totally phase out the old domain http requests whilst keeping the email from it.

I realize .htaccess could probably do this, but setting up some DNS Records seems like the more "correct" method, and alas DNS records are one thing I have never needed to mess with!

Hope I am clear, any links, or suggestions would be great, no, superb.

Thank you all for your time and have a great day!

-zack

spacious
04-27-2008, 06:02 PM
I am actually thinking of doing an .htaccess 301 cloaked redirection w/ this... better way?

spacious
04-27-2008, 06:19 PM
Here is the simple .htaccess code which works for me
(mod_rewrite enabled of course)

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain1.com [NC]
RewriteRule ^(.*)$ http://domain2.com/$1 [L,R=301]

Hope this helps anyone...

wildjokerdesign
04-27-2008, 07:01 PM
It seems you solved your own problem before anyone could arrive and help.:) I think what you have done should be fine. If I understand what you want this is most likely the easiest way to do it. The other alternative would be to use your .htaccess to point them to a central page on the old domain that explained you where phaseing out the domain and that you wanted them to use the new domain. Send them to something like this:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain1.com [NC]
RewriteRule ^(.*)$ http://domain1.com/transferpage.php?oldpage=$1 [L,R=301]

On this transferpage.php you would have their original request in $_GET['oldpage'] and could use that to provide them a link that had the new domain name. That is simplifying things a bit since you should really do some filtering on the $_GET['oldpage'] but give you a general idea. This might help with visitor cofidence in your domain. They may be a bit startled to have typed in one domain and then ended up at another without some explanation. :) I guess if on the new domain pages you have an overall announcement you could skip all this and just use your current .htaccess.

spacious
04-27-2008, 08:09 PM
Thanks Shawn, yeah I tried a few things and thought I should post my solution before anyone else wasted too much time on it! (I guess I should think things through before posting, although typing something out really helps you sometimes)

I definitely agree with you about having an announcement. Our site has kind of been in a transitional stage for so long (and had the same name) that I hope people will get it!
(we're going from http://switch.burn.tv to http://switchburn.com). The real concern for me was that we have embedded flash video players floating around with the old domain linked in and I didn't want all the blogs calling me!

Thanks again and if WH isn't cutting you a deal on hosting with all the support you give, shame on them!

-zack

wildjokerdesign
04-27-2008, 11:40 PM
I think you went the right direction knowing now what the "switch" is. :) I doubt you'll have much problem with users even noticing the differences in the domain name.

P.S. I don't think it hurt that you posted in the first place. I am sure that at some point there well be another user that is wanting to do something similar and if they see your post well have the answer! Information is never a bad thing. ;)