Redirecting Traffic to new domain

Using a single web hosting account to host multiple sites

Redirecting Traffic to new domain

Postby rakesh_kpn » Thu May 22, 2008 4:04 am

Hi,
I am using godaddy hosting where I have one hosting and multiple domain

Now My problem is to redirect traffic to my new domain from the old domain.

My Old domain is in /

My new domian is in /New Directory

now what I want is

www.OldDomain.com -> www.Olddomain.com
www.NewDomain.com -> www.NewDomain.com

www.OldDomain.com/any.html -> www.newdomain.com/any.html
www.OldDomain.com/dir/any.html -> www.newdomain.com/dir/any.html

I tried lot of options it is not working.Please help me..
rakesh_kpn
 
Posts: 3
Joined: Thu May 22, 2008 1:24 am

Postby richardk » Thu May 22, 2008 1:59 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)olddomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby rakesh_kpn » Thu May 22, 2008 6:16 pm

Hi Richard,

Thanks for your quick reply.
I tried your code but I am getting it as like this.
www.OldDomain.com -> www.newdomain.com// <--

But Actually I want to keep the OldDomain Main page as it is(www.olddomain.com -> www.olddomain.com). Because from www.OldDomain.com I am getting lot of traffic.

And I want to Avoid Search engine Ban for Duplicate Content for Main Page.

I tried and working temporary except the main page with the following code.
For main page file I am keeping is "main.php".
Currently This setp up is as alias and points to /.

But this code gives the same main page for both the domains. This is the problem what I need to solve.
But I think this may work if it is copied to different directory.

Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^OldDomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.OldDomain.com/1$ [R=301,L]
RewriteRule ^/(.*).html$ http://www.NewDomain.Com/$1.htmlR=301,L]
RewriteRule ^/(.*)/(.*)$ http://www.NewDomain.Com/$1/$2 [R=301,L]

rakesh_kpn
 
Posts: 3
Joined: Thu May 22, 2008 1:24 am

Postby richardk » Sun May 25, 2008 10:09 am

Sorry, i missed that. Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)olddomain\.com$ [NC]
RewriteRule ^(.+)$ http://www.newdomain.com/$1 [R=301,L]


Or
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)olddomain\.com$ [NC]
RewriteRule !^(main\.php)?$ http://www.newdomain.com%{REQUEST_URI} [NC,R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby rakesh_kpn » Wed Jun 11, 2008 8:27 pm

I richard,
Thank you for your valuable suggestion.
Here I Planned to move the entire web pages including the home page.
It is not a good idea to keep the main page. As it affects in Searches, as the new pages ca not compete with the old main page.So I decided to move all pages. Now the job is easy.
Thanks richard for your suggestions.
rakesh_kpn
 
Posts: 3
Joined: Thu May 22, 2008 1:24 am


Return to Domain Handling

Who is online

Users browsing this forum: Google [Bot] and 28 guests

cron