sample HTACCESS file with 301 redirects needed

Discussion in 'Site & Server Administration' started by Pixelrage, Oct 27, 2008.

  1. #1
    Can someone please post an example of an HTACCESS file using multiple 301 redirects? I've been searching on Google and I can't seem to find one.

    I know all of the 301 commands, but would like to see an actual HTACCESS file set up with them.
     
    Pixelrage, Oct 27, 2008 IP
  2. mdvaldosta

    mdvaldosta Peon

    Messages:
    4,079
    Likes Received:
    362
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    redirect 301 /path-to-old-url.html http://www.yoursite.com/path-to-new-url.html
    redirect 301 /path2-to-old-url.html http://www.yoursite.com/path2-to-new-url.html
    
    Code (markup):
     
    mdvaldosta, Oct 27, 2008 IP
    Pixelrage likes this.
  3. Pixelrage

    Pixelrage Peon

    Messages:
    5,083
    Likes Received:
    128
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks - could you please include the areas before and after? Would it include the mod rewrite line?
     
    Pixelrage, Oct 27, 2008 IP
    1 person likes this.
  4. maestria

    maestria Well-Known Member

    Messages:
    705
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #4
    Just put the code in .htaccess and it should work for you.
     
    maestria, Oct 28, 2008 IP
  5. Pixelrage

    Pixelrage Peon

    Messages:
    5,083
    Likes Received:
    128
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks, just wanted to make sure that the 301 lines can simply go in the middle of the existing HTACCESS commands.
     
    Pixelrage, Oct 28, 2008 IP
  6. pachecus

    pachecus Well-Known Member

    Messages:
    1,841
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    110
    #6
    pachecus, Oct 28, 2008 IP
    Pixelrage likes this.