Advertisement:

Author Topic: htaccess Conditional Redirect Variables For Old Open SEF URLs To Non-SEF URLs  (Read 8908 times)

Offline FidelGonzales

  • Semi-Newbie
  • *
  • Posts: 66
  • Gender: Male
    • @FidelGonzales on Twitter
    • http://ActionArmory.co
I am looking to complete the migration of a site that has SMF / JoomlaHacks Bridge installed using OpenSEF. I am also upgrading from SMF 1.0 to SMF 2.0 / SJSB Bridge. In doing this, the dynamic forum URLs will change, and I am in need of some assistance with .htaccess for variable redirects. Everything I have tried thus far is not function properly. Below are the variables. I would post what I have tried thus far but do not want to confuse the issue any more than it already is. Thanks.

BOARD - OLD URL
http://www.MYSITE.com/forums/index.php?board=186.0
BOARD - NEW URL
http://www.MYSITE.com/index.php?option=com_smf&Itemid=87&board=186.0

THREAD TOPIC - OLD URL
http://www.MYSITE.com/forums/index.php?topic=501.0
THREAD TOPIC - NEW URL
http://www.MYSITE.com/index.php?option=com_smf&Itemid=87&topic=501.0

Offline FidelGonzales

  • Semi-Newbie
  • *
  • Posts: 66
  • Gender: Male
    • @FidelGonzales on Twitter
    • http://ActionArmory.co
Here is what I have concocted. It doesn't seem to work, but it is on a shared account, where htaccess may be actively cached. Therefore, the results may take time.

Code: [Select]
rewritecond %{query_string} &?board=([^&]+) [NC]
rewriterule ^forums/index\.php$ /board=/%1? [NC,L]

Offline FidelGonzales

  • Semi-Newbie
  • *
  • Posts: 66
  • Gender: Male
    • @FidelGonzales on Twitter
    • http://ActionArmory.co
Here's my next attempt.

Code: [Select]
rewritecond %{query_string} ^board=(.*)$
rewriterule ^forums/board\.asp$ http://www.MySite.com/%1/? [R=301,L]

Orstio

  • Guest
.htaccess redirects can end up being far too broad.

You're better off adding a little spike in your forum index.php, like this:

http://www.simplemachines.org/community/index.php?topic=81152.msg541379#msg541379