1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Redirect

Discussion in 'Blogging' started by maildigger, Oct 28, 2011.

  1. maildigger

    maildigger Power Member

    Joined:
    Jan 30, 2009
    Messages:
    558
    Likes Received:
    60
    Location:
    EU
    I have an old php website with +500 deep urls which are getting some decent Google traffic. I'm switching to wordpress and new url structure. How should I redirect this? I want to redirect all the current traffic + linkjuice to the main url.
     
  2. InternetMaster

    InternetMaster Junior Member

    Joined:
    Oct 22, 2011
    Messages:
    143
    Likes Received:
    61
    Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.
    The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

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

    REPLACE newdomain in the above code with your actual domain name.

    In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.

    This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.
     
    • Thanks Thanks x 1