301 Redirect

Discussion in 'Site & Server Administration' started by H-Man, Aug 25, 2005.

  1. #1
    OK, I have search for how to do a 301 redirect, but the search comes up with a lot of $%^# I don't want to read through. Does anyone know of a thread that explains it?
     
    H-Man, Aug 25, 2005 IP
  2. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hope that help.
     
    just-4-teens, Aug 25, 2005 IP
  3. SpeedyDomainRegistration

    SpeedyDomainRegistration Peon

    Messages:
    170
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    different way to doing redirect for 1 page or several pages.

    RewriteEngine ON
    Redirect 301 /old-page.html http://www.newdomain/new-page.html
    Code (markup):
     
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    Would also help to know what web server you are using.
     
    digitalpoint, Aug 26, 2005 IP
  5. Perrow

    Perrow Well-Known Member

    Messages:
    1,306
    Likes Received:
    78
    Best Answers:
    0
    Trophy Points:
    140
    #5
    This is from a file I actually had open in Dreamweaver when I saw this thread. For ASP files.

     
    Perrow, Aug 26, 2005 IP
  6. frankm

    frankm Active Member

    Messages:
    915
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    83
    #6
    and to convert that to php:
    
    <?
    header("HTTP 301 Moved Permanently");
    header("Location: http://www.learnaboutspam.com/spam/default.asp");
    ?>
    
    PHP:
     
    frankm, Aug 26, 2005 IP
  7. H-Man

    H-Man Peon

    Messages:
    172
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I guess I don't really know what a 301 redirect accomplishes. Is it just sending the user/bot to a different page. Sort of like a meta refresh? (only different)

    IIS 5 is what I am using.
     
    H-Man, Aug 26, 2005 IP
  8. Perrow

    Perrow Well-Known Member

    Messages:
    1,306
    Likes Received:
    78
    Best Answers:
    0
    Trophy Points:
    140
    #8
    A 301 tells the browser (and SEs) that the requested document has been moved permanently to another location and also what this new location is.

    Meta refreshes are almost ignored by SEs as they can be conditional.
     
    Perrow, Aug 26, 2005 IP
  9. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #9
    
    <?
    header("HTTP/1.0 301 Moved Permanently");
    header("Location: http://somesite.com/");
    exit;
    ?>
    
    PHP:
    301's can be conditional too :D
     
    exam, Aug 26, 2005 IP