Best Way to Move Site From Subdomain to Main Domain

Discussion in 'Search Engine Optimization' started by UWStudent, Feb 21, 2009.

  1. #1
    Hello,

    I've built my site on the subdomain of my main domain thinking that in the future I might use my main domain as a more general site.
    Well my main domain has been blank for so long that
    now I want to move the subdomain site to the main domain.

    I'm getting some natural traffic from google and I dont want to lose that.
    I was hoping you guys can share your expertise here.
    Whats the best way to carry this out without losing your Google rankings?

    Thanks
     
    UWStudent, Feb 21, 2009 IP
  2. olti

    olti Well-Known Member

    Messages:
    436
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    145
    #2
    The best way is to use 301 redirects.
    If you link structure is going to be the same (it's better not to change it) than you can add this code:
    RewriteEngine on
        RewriteRule (.*) http://www.yourmainsite.tld/$1 [R=301,L]
    Code (markup):
    in your .htaccess file of the subdomain directory and the users plus the SE bots will be redirected to main domain.

    Cheers
     
    olti, Feb 21, 2009 IP
  3. UWStudent

    UWStudent Peon

    Messages:
    105
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks olti!
    Yup, the file/link structure is not changing.

    When can i get rid of the subdomain?
    Will the existing indexed pages in google update to the main domain?
     
    UWStudent, Feb 21, 2009 IP