Changing forum software, trying to redirect old to new with mod_rewrite

Discussion in 'Apache' started by al2six, May 23, 2006.

  1. #1
    I'm changing the forum software I'm using and i have imported all the posts from the old forum into the new. What I'm trying to do is redirect users who are trying to view a post on the old software to the same post on the new software. here's what i put in my .htaccess file:

    RewriteRule ^forum/index.php?showtopic=(.*)$ forumredirect.php?topic=$1 [L]

    and then forumredirect.php takes the topic id # and uses a 301 to send the user to the new url. however, this isn't working. when i attempt to view a post on the old software, it loads just fine, instead of sending me to forumredirect.php

    anyone know what i'm doing wrong?

    thanks
     
    al2six, May 23, 2006 IP
  2. Nathan Malone

    Nathan Malone Well-Known Member

    Messages:
    369
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    110
    #2
    If you could post the URLs and the entire .htaccess file, that would be useful.

    From what I see now, I would recommend redirecting directly from the .htaccess file like this:

    RewriteRule ^forum/index.php?showtopic=(.*)$ newforum.php?topic=$1 [R=301,L]

    I would really need to see more to be able to debug it more, though. One other thought is perhaps you need to strip out the "forum/" from the line, if the htaccess file is in the same directory as the forum directory.
     
    Nathan Malone, May 24, 2006 IP