best way to move a subdoamin to its own domain name

Discussion in 'Domain Names' started by thesamemanhal, Oct 28, 2009.

  1. #1
    thesamemanhal, Oct 28, 2009 IP
  2. thesamemanhal

    thesamemanhal Active Member

    Messages:
    1,126
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    55
    #2
    I have already registered a main domain as www.name.com but I am not sure how can I rewrite the rules, where and how ?
     
    thesamemanhal, Oct 29, 2009 IP
  3. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #3
    For what u want edit this below code and add it to your .htaccess

    
    #Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www.olddomain.com$[OR]
    RewriteCond %{HTTP_HOST} ^olddomain.com$
    RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L] 
    
    Code (markup):
     
    Bohra, Oct 29, 2009 IP
  4. thesamemanhal

    thesamemanhal Active Member

    Messages:
    1,126
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    55
    #4
    Thank you Bohra, I will put this code into my .htaccess soon
     
    thesamemanhal, Oct 29, 2009 IP
  5. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #5
    Dont forget to edit it with your details
     
    Bohra, Oct 29, 2009 IP
  6. thesamemanhal

    thesamemanhal Active Member

    Messages:
    1,126
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    55
    #6
    yes, of course; so according to what I have in the first message the code will be something like this:

    #Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www.name.mysite.com$[OR]
    RewriteCond %{HTTP_HOST} ^name.mysite.com$
    RewriteRule ^(.*)$ http://www.name.com/$1 [R=301,L]
    Code (markup):
    please let me know if I am missing anything
     
    thesamemanhal, Oct 29, 2009 IP
  7. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #7
    you wont need this line

    RewriteCond %{HTTP_HOST} ^www.name.mysite.com$[OR]


    as ur on a sub domain
     
    Bohra, Oct 29, 2009 IP
  8. thesamemanhal

    thesamemanhal Active Member

    Messages:
    1,126
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    55
    #8
    Oh, I see.

    so here it is...

    #Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^name.mysite.com$
    RewriteRule ^(.*)$ http://www.name.com/$1 [R=301,L]
    Code (markup):
    thank you again
     
    thesamemanhal, Oct 29, 2009 IP
  9. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #9
    Yes thats it... will work properly
     
    Bohra, Oct 29, 2009 IP