Redirect http://www.mydomain.com to http://mydomain.com

Discussion in 'Search Engine Optimization' started by Fewleftstanding, Jul 10, 2007.

  1. #1
    Hey,

    I can't remember what this is called (301 redirect?).

    www.mydomain.com has PR2
    http://mydomain.com is PR3

    I want to redirect everything going from http://mydomain.com to www.mydomain.com..for PR reasons. Whats the code to enter into my htaccess? It is a forum.

    Also, would it be best to redirect www.mydomain.com to http://mydomain.com or from mydomain.com to www.mydomain.com? Most people would link to the site using www.mydomain.com, so I would think its better for PR reasons. But then when you do a 301 redirect, isn't the PR forwarded anyway?

    Thanks in advance. :)
     
    Fewleftstanding, Jul 10, 2007 IP
  2. calder

    calder Peon

    Messages:
    192
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Redirect mydomain.com to www.mydomain.com :

    RewriteEngine On
    rewritecond %{http_host} ^mydomain.com
    rewriteRule ^(.*) http://www.mydomain.com/$1 [R=301,L]
     
    calder, Jul 11, 2007 IP
  3. Fewleftstanding

    Fewleftstanding Peon

    Messages:
    438
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks a lot!
     
    Fewleftstanding, Jul 11, 2007 IP
  4. mikerocky

    mikerocky Well-Known Member

    Messages:
    476
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    123
    #4
    I could do with a bit of help on this too, so do i just drop that code into my head tag somewhere?
     
    mikerocky, Jul 12, 2007 IP
  5. Ratman2050

    Ratman2050 Well-Known Member

    Messages:
    2,748
    Likes Received:
    176
    Best Answers:
    0
    Trophy Points:
    155
    #5
    301 Redirect is what it is called:

     
    Ratman2050, Jul 12, 2007 IP
  6. catanich

    catanich Peon

    Messages:
    1,921
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    0
    #6
    What is the best way to do this for a "Classic ASP" site and or a .NET site?
     
    catanich, Jul 12, 2007 IP
  7. Fewleftstanding

    Fewleftstanding Peon

    Messages:
    438
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Would this also work if I wanted to move example.com/forum to example.com? Would my file look like the following?

     
    Fewleftstanding, Jul 12, 2007 IP