Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Joomla Bridge Support => Topic started by: FidelGonzales on February 05, 2009, 03:08:11 PM

Title: htaccess Conditional Redirect Variables For Old Open SEF URLs To Non-SEF URLs
Post by: FidelGonzales on February 05, 2009, 03:08:11 PM
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
Title: Re: htaccess Conditional Redirect Variables For Old Open SEF URLs To Non-SEF URLs
Post by: FidelGonzales on February 05, 2009, 03:58:39 PM
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]
Title: Re: htaccess Conditional Redirect Variables For Old Open SEF URLs To Non-SEF URLs
Post by: FidelGonzales on February 05, 2009, 04:29:42 PM
Here's my next attempt.

Code: [Select]
rewritecond %{query_string} ^board=(.*)$
rewriterule ^forums/board\.asp$ http://www.MySite.com/%1/? [R=301,L]
Title: Re: htaccess Conditional Redirect Variables For Old Open SEF URLs To Non-SEF URLs
Post by: Orstio on February 05, 2009, 06:38:18 PM
.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