how to do a wordpress redirect?

8 replies
Does anybody know how to make a entire wordpress site redirect immediately?
#redirect #wordpress
  • Profile picture of the author Matthew Shane Roe
    You would have to put a permanent re-direct on the domain name. This can be done through your cpanel.
    {{ DiscussionBoard.errors[5287015].message }}
    • Profile picture of the author Seanjtucker
      Originally Posted by Skid_Roe View Post

      You would have to put a permanent re-direct on the domain name. This can be done through your cpanel.
      will the site still pick up its seo value and be able to rank in google still?

      Originally Posted by Soren View Post

      The most SEO friendly redirect is the 301 redirect. Usually you do it in a PHP file containing the following code:

      <?php header("Location: google.com"); ?>

      But in your case you'd probably want to do it using the .htaccess file

      In the .htaccess file you just write:

      Redirect 301 / http:// goo gle .com <- without the spaces. Just to avoid the text editor to turn it into a anchor text link

      Perhaps you'd want to back it up first, just for your own convenience.

      I have no clue how to make an .htaccess file... I have to look it up.

      Thanks
      Signature

      {{ DiscussionBoard.errors[5287381].message }}
      • Profile picture of the author Matthew Shane Roe
        Originally Posted by Seanjtucker View Post

        will the site still pick up its seo value and be able to rank in google still?

        Thanks
        I've had it set that way for a couple of weeks now on one of my review sites. The ranking hasn't changed and I'm still able to view where the traffic is coming from. Not only through the analytics on the site it's being re-directed to, but through the analytics of the re-directed site itself.

        Edit: It's also actually A LOT easier than trying to edit files through cpanel. The only problem you will have if you screw something up is the site won't re-direct.
        {{ DiscussionBoard.errors[5287495].message }}
  • Profile picture of the author Soren
    The most SEO friendly redirect is the 301 redirect. Usually you do it in a PHP file containing the following code:

    <?php header("Location: google.com"); ?>

    But in your case you'd probably want to do it using the .htaccess file

    In the .htaccess file you just write:

    Redirect 301 / http:// goo gle .com <- without the spaces. Just to avoid the text editor to turn it into a anchor text link

    Perhaps you'd want to back it up first, just for your own convenience.
    {{ DiscussionBoard.errors[5287222].message }}
  • Profile picture of the author UMS
    If you want to preserve the mapping between the old new sites, then create a .htaccess file with:
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^oldsite.com$
    RewriteRule ^(.*)$ "http\:\/\/newsite\.com/$1" [R=301,L]
    {{ DiscussionBoard.errors[5287252].message }}
    • Profile picture of the author Seanjtucker
      Originally Posted by UMS View Post

      If you want to preserve the mapping between the old new sites, then create a .htaccess file with:
      Code:
      RewriteEngine On
      RewriteCond %{HTTP_HOST} ^oldsite.com$
      RewriteRule ^(.*)$ "http://newsite.com/$1" [R=301,L]
      preserve the mapping meaning how a visitor gets to the site???
      Signature

      {{ DiscussionBoard.errors[5287318].message }}
  • Profile picture of the author Soren
    You already have one Sean, just look in the root of your domain and open it in a text editor like notepad
    {{ DiscussionBoard.errors[5287435].message }}

Trending Topics