How I move my old WP blog to a new domain on my hosting account?

Discussion in 'WordPress' started by blog4fun, Jul 7, 2011.

  1. #1
    Hi guys I want to move my old blog to a new domain on the same hosting service. The reason is that my old domain name is not very good. So I want to move or 301 redirect my old blog to a new domain with all the blog post.

    Can you please share me the exact process to doing this? Also please inform me that will the new blog get all the SEO stats of my old blog within 2-3 months?

    Thanks in advance.
     
    blog4fun, Jul 7, 2011 IP
  2. тнє Sufi

    тнє Sufi Peon

    Messages:
    391
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Process to change domain:
    Go to your WP dashboard > Settings > General :
    Update WordPress address (URL) and Site address (URL) with new domain. Don't give a trailing slash.
    Then go to PHPMyAdmin from your cPanel/Hosting control Panel > Click on your database > Click on SQL tab > write following command one by one:
    
    UPDATE wp_posts SET guid = replace(guid, 'hxxp://www.old-domain.com','hxxp://www.new-domain.com');
    
    PHP:
    change your domains accordingly and make hxxp to http :D
    After running this, run following one:
    
    UPDATE wp_posts SET post_content = replace(post_content, 'hxxp://www.old-domain.com', 'hxxp://www.new-domain.com');
    
    PHP:
    And you are done :D
     
    тнє Sufi, Jul 7, 2011 IP
  3. blog4fun

    blog4fun Active Member

    Messages:
    493
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    50
    #3
    Hey buddy thanks for this help. Well this procedure is for completely for moving my old blog to new blog? And what will happen when someone click on my old blog post? and will all the SEO things will transfer to my new domain?
     
    blog4fun, Jul 7, 2011 IP
  4. тнє Sufi

    тнє Sufi Peon

    Messages:
    391
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Put following lines in your .htaccess file of the old domain:
    
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L] 
    
    PHP:
    It will then redirect all your old blog post links to new domain :)
     
    тнє Sufi, Jul 7, 2011 IP
  5. blog4fun

    blog4fun Active Member

    Messages:
    493
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    50
    #5
    Thanks lot buddy...Lets try it..
     
    blog4fun, Jul 7, 2011 IP
  6. blog4fun

    blog4fun Active Member

    Messages:
    493
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    50
    #6
    Hi I have done, every this is going fine, I also done 301 redirection, but when I click on old domain homepage, it still not redirect to my new domain.
     
    blog4fun, Jul 8, 2011 IP
  7. blog4fun

    blog4fun Active Member

    Messages:
    493
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    50
    #7
    Friend I have 301 redirect on my .htaccess file by using your said code, now homepage is redirecting, but not the post and pages. Please inform me what I will have to do. Thanks
     
    blog4fun, Jul 8, 2011 IP
  8. тнє Sufi

    тнє Sufi Peon

    Messages:
    391
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Ok try this one. Remove old .htaccess content in the root folder of the old domain, and replce it with following codes:

    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^.*old-domain\.com$ [NC]
    RewriteRule ^(.*)$ http://new-domain.com/$1 [R=301,L]
    PHP:
    First try this one, if it does not work as well, then try the below one (remove previous code):

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^old-domain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.old-domain.com$
    RewriteRule (.*)$ http://www.new-domain.com/$1 [R=301,L]
    PHP:

    But the code I have given you previously, should have working perfectly. Did you put that code properly at your old-domain's root folder?
     
    тнє Sufi, Jul 8, 2011 IP
  9. williamsweb

    williamsweb Active Member

    Messages:
    2,016
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    75
    #9
    wordpress.org help have mentioned this guide - search it
     
    williamsweb, Jul 8, 2011 IP
  10. blog4fun

    blog4fun Active Member

    Messages:
    493
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    50
    #10
    Hey brother, now it is working fine, actaully there was a problem in my .htaccess file, there are already some code on that file and I wrongly placed the 301 code, after placing the code on the right place now it is working fine, all the post also redirect to the new post, well if you have experienced within how many period I will get all the SEO stats on my blog
     
    blog4fun, Jul 8, 2011 IP
  11. тнє Sufi

    тнє Sufi Peon

    Messages:
    391
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    nice to hear it is working. I am not much good in SEO :)
     
    тнє Sufi, Jul 8, 2011 IP