Redirecting Traffic from old site to new site using .httaccess

Discussion in 'HTML & Website Design' started by rakesh_kpn, May 18, 2008.

?

How many days you took for Diverting trafiic from old domain to newdomain?

Poll closed May 22, 2008.
  1. 1-2 Days

    0 vote(s)
    0.0%
  2. 1-5 Days

    0 vote(s)
    0.0%
  3. 1- 7 days

    0 vote(s)
    0.0%
  4. 1- 15 Days or more

    1 vote(s)
    100.0%
Multiple votes are allowed.
  1. #1
    Today full time I was trying for getting the script for redircting traffic from old domain to new domain but keeping the olddomain main page.

    finally i Succeeded the code will be like this

    1 Options +FollowSymLinks
    2 RewriteEngine On
    3 RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC]
    4 RewriteRule ^(.*)$ http://www.olddomain.com [R=301,L]
    5 RewriteRule ^/(.*)$ http://www.newdomain.com/$1 [R=301,L]
    6 RewriteRule ^/(.*)/(.*)$ http://www.newdomain.com/$1/$2 [R=301,L]

    5th line converts olddomain/webpage.html ->newdomain/webpage.html
    6 th line converts olddomain/dir/file.html->newdomain/dir/file.html

    May be use full those who need it to redirect traffic.
     
    rakesh_kpn, May 18, 2008 IP
  2. Divisive Cottonwood

    Divisive Cottonwood Peon

    Messages:
    1,674
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Keep it there indefinitely - why do you need to set a timelimit?

    I guess it depends on how much work you have done in building links and SERP positions...

    Keep the redirection going for as long as what you can...
     
    Divisive Cottonwood, May 18, 2008 IP