WordPress.org

Ready to get started?Download WordPress

Forums

Domain Change and 301 Redirect (6 posts)

  1. ariahfine
    Member
    Posted 5 years ago #

    I need some help and reassurance about how to transfer my blog to a new URL. I own both domains, keeping the install on the same server, I simply have a question about how to use the 301 Redirect.

    I want to be sure that no matter what page someone lands on in my old URL (via google search, old links, etc), that it redirects them to the same page on the new domain URL. I'm not changing the permalinks so it should be a simple process.
    For example, I want someone who goes here:
    http://blog.iamnotashamed.net/2009/02/09/economy-straight-talk/
    to be redirected to this URL instead:
    http://tryingtofollow.com/2009/02/09/economy-straight-talk/

    Is it possible to do that with a 301 redirect?

    Thanks.

  2. Jorge A. Gonzalez
    Member
    Posted 5 years ago #

    ya, you should do that with htaccess on your old server.

  3. Shane G
    Member
    Posted 5 years ago #

    Hi,

    you need to add redirect code in .htaccess file and this is an example of the code:

    Redirect 301 /old.php http://www.domain.com/folder/new.php

    Thanks,

    Shane G.

  4. ariahfine
    Member
    Posted 5 years ago #

    thanks, so with your example though, do I actually put "old" and "new", I'm assuming not.

    How do I create an .htaccess file that uses the same url, and simply changes the domain?
    From my example, how do I reference this part to be the same:
    /2009/02/09/economy-straight-talk/

    Thanks for the details.

  5. ariahfine
    Member
    Posted 5 years ago #

    Hey all, so it was super easy. This is what I used:

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

    put that in a .htaccess and it properly links all your old URLs to the new ones.

  6. kelphugger
    Member
    Posted 4 years ago #

    I want to do the same but what if i need to redirect to both a new domain and folder.

    example:

    http://olddomain.com ----> http://www.newdomain.com/newfolder/

Topic Closed

This topic has been closed to new replies.

About this Topic