htaccess Conditional Redirect Variables For Old Open SEF URLs To Non-SEF URLs

Started by FidelGonzales, February 05, 2009, 03:08:11 PM

Previous topic - Next topic

FidelGonzales

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

FidelGonzales

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.

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

FidelGonzales

Here's my next attempt.

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

Orstio

.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

Advertisement: