another rewrite question?

Discussion in 'Apache' started by bentong, Dec 12, 2005.

  1. #1
    I've setup a forum on the root directory and decided to move it on /forum directory.

    what is the best way to redirect to avoid dup content and traffic loss?
     
    bentong, Dec 12, 2005 IP
  2. fsmedia

    fsmedia Prominent Member

    Messages:
    5,163
    Likes Received:
    262
    Best Answers:
    0
    Trophy Points:
    390
    #2
    Use a 301 redirect from / to /forum/ that will also pass along the Pagerank if there is any.
     
    fsmedia, Dec 12, 2005 IP
  3. bentong

    bentong Banned

    Messages:
    3,543
    Likes Received:
    257
    Best Answers:
    0
    Trophy Points:
    0
    #3
    how about for the threads?
     
    bentong, Dec 12, 2005 IP
  4. fsmedia

    fsmedia Prominent Member

    Messages:
    5,163
    Likes Received:
    262
    Best Answers:
    0
    Trophy Points:
    390
    #4
    Are you wanting to put new content at / or just simply redirect everything to /forum/ and put new content there later?

    Also, a good known fact is that cool and good URIs don't change, which means you should always stick with the original URI structure (aka not moving). If this is your last resort then ok, but as a piece of advice, don't change URIs, ever.
     
    fsmedia, Dec 12, 2005 IP
    bentong likes this.
  5. bentong

    bentong Banned

    Messages:
    3,543
    Likes Received:
    257
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I am adding a new content on / directory so I moved the forum into /forum directory..
     
    bentong, Dec 12, 2005 IP
  6. fsmedia

    fsmedia Prominent Member

    Messages:
    5,163
    Likes Received:
    262
    Best Answers:
    0
    Trophy Points:
    390
    #6
    Sorry, I'm not that great with mod_rewrite, but i know how to get around for small stuff. you'll want something along the lines of Rewrite /showthread.php?p=(.*) /forum/showthread.php?p=$1 or something like that. Someone else will know a lot better than I do.
     
    fsmedia, Dec 12, 2005 IP
  7. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #7
    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^showthread.php?p=([^.]+)$ http://www.domain.com/forum/showthread.php?p=$1 [R=301,L]
    RewriteRule ^forumdisplay.php?f=([^.]+)$ http://www.domain.com/forum/forumdisplay.php?f=$1 [R=301,L]
     
    Nintendo, Dec 12, 2005 IP
  8. bentong

    bentong Banned

    Messages:
    3,543
    Likes Received:
    257
    Best Answers:
    0
    Trophy Points:
    0
    #8
    thanks for the rule. :)
     
    bentong, Dec 13, 2005 IP