Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 19th March 2009, 18:11
wpwood3 wpwood3 is offline
Senior Member
 
Join Date: Oct 2007
Location: Atlanta, GA USA
Posts: 197
Thanks: 21
Thanked 31 Times in 21 Posts
Question Domain and email forwarding to new domain

How can I forward all of my web and email traffic from an old domain to a new domain?

For example:

For web traffic:
olddomain.tld/index.html > newdomain.tld/index.html
olddomain.tld/folder1/index.php > newdomain.tld/folder1/index.php

Domain forwarding at the registrar will forward web traffic but it doesn't seem to forward the email. We have external spam filtering for all incoming mail but I don't think that is the problem since the translation to "newdomain" would occur at the registrar prior to reaching the filter.

For email traffic:
joe@olddomain.tld > joe@newdomain.tld
sam@olddomain.tld > sam@newdomain.tld

I don't care if the forwarding is done at the registrar or my server but I do need all web traffic and email to be sent to the new domain.

Any ideas?
__________________
CentOS 5.4 64bit (the Perfect Setup)
ISPConfig 2.2.40
WP3 Photography
Reply With Quote
Sponsored Links
  #2  
Old 20th March 2009, 08:38
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,771
Thanks: 821
Thanked 5,331 Times in 4,183 Posts
Default

Just use the email forwarding function that is builtinto ispconfig or you add a postfix transport in the transports file manually.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 20th March 2009, 16:28
wpwood3 wpwood3 is offline
Senior Member
 
Join Date: Oct 2007
Location: Atlanta, GA USA
Posts: 197
Thanks: 21
Thanked 31 Times in 21 Posts
Question What about web traffic?

If I forward the domain at the registrar then the email will never reach my server so ISPConfig will not be able to forward the email.

If I do not forward the domain at the registrar and use ISPConfig to forward the email as you suggest, how can I forward the web traffic?
Each web page on the old domain must forward to the same webpage on the new domain like this:
olddomain.tld/index.html > newdomain.tld/index.html
olddomain.tld/folder1/index.php > newdomain.tld/folder1/index.php
__________________
CentOS 5.4 64bit (the Perfect Setup)
ISPConfig 2.2.40
WP3 Photography
Reply With Quote
  #4  
Old 21st March 2009, 20:57
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

You can use mod_Rewrite for it. Take a look here: http://httpd.apache.org/docs/2.2/rew...ite_guide.html
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 26th March 2009, 23:01
wpwood3 wpwood3 is offline
Senior Member
 
Join Date: Oct 2007
Location: Atlanta, GA USA
Posts: 197
Thanks: 21
Thanked 31 Times in 21 Posts
Question Is this correct?

Thanks for your help.

Let me make sure I understand exactly what you are saying by describing the steps I think I need to take. Maybe I'm making this too complex.

1) At the registrar, point my newdomain to the nameservers on my server.

2) In ISPConfig ISP Manager go to the ISP Site and change the Domain name of my olddomain to my newdomain. (This is easier than moving all of my content from web1 to web2)

3) In ISPConfig ISP Manager create a new site with the olddomain name.

4) In the web root directory of the site created in step#3 above create a .htaccess file to perform 301 redirects to the newdomain:

Quote:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^olddomain.com [nc]
rewriterule ^(.*)$ http://www.olddomain.com/$1 [r=301,nc]
5) In ISPConfig ISP Manager go to the site created in step#3 above and create all olddomain email accounts and forward then to the corresponding newdomain email accounts. (there are only about 15)

Hopefully this will forward all of my web traffic and emails without hurting my Google search ranking too much. That's the main objective. I have read that doing the 301 at the registrar instead of the host may hurt search rankings.

Is there an easier way?
__________________
CentOS 5.4 64bit (the Perfect Setup)
ISPConfig 2.2.40
WP3 Photography
Reply With Quote
  #6  
Old 27th March 2009, 14:50
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

You don't need to create a new web site in ISPConfig. You can add newdomain.com and www.newdomain.com as Co-Domains to the olddomain.com web site and then add the correct rewrite rules so that olddomain.com is redirected to newdomain.com.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 27th March 2009, 16:16
wpwood3 wpwood3 is offline
Senior Member
 
Join Date: Oct 2007
Location: Atlanta, GA USA
Posts: 197
Thanks: 21
Thanked 31 Times in 21 Posts
Default

Thanks falko.

Instead of using .htaccess for the 301 redirect can I use "Apache Directives (Optional):" in ISPConfig?
Maybe put something like this there:
Quote:
RewriteCond %{HTTP_HOST} !^www\.newdomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
The 301 redirect is critical for SEO and it also makes sure the "www" is present in the URL.

Since olddomain.com will be going away I think I will change the Domain of the site to newdomain.com and create co-domains for olddomain.com and www.olddomain.com. That way I can simply delete the co-domains in a year or so when I no longer need them. I think that will do the same thing as you suggest.
__________________
CentOS 5.4 64bit (the Perfect Setup)
ISPConfig 2.2.40
WP3 Photography

Last edited by wpwood3; 27th March 2009 at 23:21.
Reply With Quote
  #8  
Old 28th March 2009, 19:24
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
 
Default

Quote:
Originally Posted by wpwood3 View Post
Instead of using .htaccess for the 301 redirect can I use "Apache Directives (Optional):" in ISPConfig?
Yes, you can do that.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
wpwood3 (28th March 2009)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
hotmail rejects outgoing email nzimas Server Operation 3 1st May 2009 03:39
Email domain forwarding stevieb Installation/Configuration 8 30th January 2009 17:51
ISPConfig 3RC1 - email domain vs. site domain across users Ben Developers' Forum 2 13th January 2009 18:57
Multiple MySQL Queries - with Postfix-mysql, courier-authmysql, maildrop-mysql... snowfly HOWTO-Related Questions 4 7th July 2006 04:19
email forwarding locally consumes all resources rdells General 20 1st May 2006 19:43


All times are GMT +2. The time now is 05:25.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.