Update indexed links on search engine from old domain to another domain?

Discussion in 'Search Engine Optimization' started by csreference, Oct 9, 2010.

  1. #1
    Hello, i need some help.

    I have a website that is very well indexed by google for a lot of keywords. But i want to direct traffic on those keywords for that link to another link on another domain. How can i make that happen?

    I already read about 301 redirect or something on google webmaster central. And also on their forum someone posted a code to be written in .htaccess file. But there is already one htaccess file, so do i need to add it on that file for the redirect to happen?

    For eg.
    Old domain indexed on google : http://www.old.com/category1/page1.php
    New domain to redirect : http://www.new.com/category4/category2/page4.php

    Thanks
     
    csreference, Oct 9, 2010 IP
  2. twalk

    twalk Peon

    Messages:
    31
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can append the code to your existing .htaccess.

    I use php to redirect traffic from old to new domain with this code will fit your case if you place it on your www.old.com/category1/page1.php:

    <?php




    $newurl = "http://www.new.com/category4/category2/page4.php";



    echo '
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta http-equiv="refresh" content="1; url='.$newurl.'" />
    <title>Page has moved. redirecting...</title>
    <meta name="robots" content="noindex,follow" />
    </head>

    <body>
    <p><a href="'.$newurl.'">Redirection</a></p>
    </body>
    </html>
    ';

    ?>

    I still wonder how to transfer PR to the new domain. I still have PR3 on the old page and PR2 at the new.
     
    Last edited: Oct 10, 2010
    twalk, Oct 10, 2010 IP
  3. csreference

    csreference Member

    Messages:
    389
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    I don't think PR can be transferred from one domain to another domain. By the way i am using Wordpress for both the websites. So if i delete the posts from old website, it will give post not found error and that's where i want to redirect to the new one.
     
    csreference, Oct 10, 2010 IP
  4. twalk

    twalk Peon

    Messages:
    31
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    For doing this, you add this line to .htaccess

    ErrorDocument 404 /category4/category2/page4.php

    Supposing the /category4/category2/page4.php is your redirecting page, any 'not found' error will redirect to your new site.
     
    twalk, Oct 10, 2010 IP
  5. csreference

    csreference Member

    Messages:
    389
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #5
    Ok and where does the new link comes?
     
    csreference, Oct 10, 2010 IP
  6. twalk

    twalk Peon

    Messages:
    31
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    It goes to what you define on this line:

    $newurl = "http://www.new.com/category4/category2/page4.php";

    Supposing you moved the domain name only, and the rest of the url must stay the same, you say:

    $newurl = "http://www.guitargang.org" . $_SERVER['REQUEST_URI'];

    Is that what you meant in your question?
     
    twalk, Oct 10, 2010 IP