Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Joomla Bridge Support => Topic started by: desquinn on January 25, 2008, 10:57:50 PM

Title: Rewriting com_smf URLs to standalone URLS
Post by: desquinn on January 25, 2008, 10:57:50 PM
Hi,

Is there a method for rewriting com_smf urls to standalone "community/index.php?topic=58.0" type urls. Either a mod_rewrite or a database update method would be great.

I have swapped from joomla bridged to standalone and want to handle url's embedded in messages.

TIA

regards
Des Quinn
Title: Re: Rewriting com_smf URLs to standalone URLS
Post by: Kindred on January 25, 2008, 11:01:54 PM
do the reverse of the database change that Goosemoose provided (listed in the combines readme thread)
Title: Re: Rewriting com_smf URLs to standalone URLS
Post by: desquinn on January 25, 2008, 11:07:20 PM
I had looked at that and thought that it was something like that but to be honest my eyes are failing and brain is confused :(

I might be better at it in the morning but any help / guidance that you can give would be great. Was unsure of doing anything like that without have some sor tof limit on it so that any mistakes are limited to one post for example

in case it helps the urls in question are as follows:

old URL:
http://www.domain.org/component/option,com_smf/Itemid,83/topic,3402.0

New URL
http://www.domain.org/community/index.php?topic=3402.0

any clarification would be great but I think that the thought of sleep is starting to win me over :)



Title: Re: Rewriting com_smf URLs to standalone URLS
Post by: Kindred on January 26, 2008, 08:18:27 AM
Quote from: Kindred on April 11, 2006, 10:55:16 AM
FIXING LINKS IN SMF MESSAGES FROM PRE-BRIDGED FORUMS

(thanks to Goosemoose for this)
If you were running a forum prior to bridging it with mambo/joomla, there will be links in
messages that point to the unbridged forum location. You can change these by going
into phpMyAdmin and running a simple SQL command on the smf_messages table.

The format is:


UPDATE smf_messages SET `body` = replace(`body`,"http://www.yoursite.com/forum/index.php?","http://www.yoursite.com/mambo/index.php?option=com_smf&Itemid=##&")


where smf_messages is your actual table (change the smf_ if you are using a different
prefix, obviously)
where http://www.yoursite.com/forum/index.php is the actual URL of your previous
(unbridged) SMF index.php.
where http://www.yoursite.com/mambo/index.php is the actual location of your MAMBO/JOOMLA
index.php
where Itemid=## is your actual SMF component Itemid

so, an example, (as provided by Goosemoose)


UPDATE rfc_messages SET `body` = replace(`body`,"http://www.goosemoose.com/rfc/index.php?topic=","http://www.goosemoose.com/index.php?option=com_smf&Itemid=70&topic=")


He used rfc_ as his SMF database table prefix and rfc was the SMF directory.
note that his mambo is installed in the root directory...



so, instead you want to do:


UPDATE smf_messages SET `body` = replace(`body`,"http://www.yoursite.com/component/option,com_smf/Itemid,83/","http://www.yoursite.com/community/index.php?")
Title: Re: Rewriting com_smf URLs to standalone URLS
Post by: desquinn on February 19, 2008, 04:10:25 AM
Just realised I forgot to say thanks for this help.

cheers.
Title: Re: Rewriting com_smf URLs to standalone URLS
Post by: arillas on February 24, 2008, 02:18:15 PM
so, instead you want to do:


UPDATE smf_messages SET `body` = replace(`body`,"http://www.yoursite.com/component/option,com_smf/Itemid,83/","http://www.yoursite.com/community/index.php?")

[/quote]

That looks right but When we have unbridged our forum and we are using joomla and smf standalone then we need to create/rewrite links like /joomlafolder/option,com_smf/Itemid,83/   in to /forumfolder/index.php?topic=3402.0 etc.
in that case if I want to run the above sql command there is no such a table in my joomla database.
how can we prevent ALL dead links when we have unbridged our forum from joomla?

cheers,

Title: Re: Rewriting com_smf URLs to standalone URLS
Post by: Kindred on February 24, 2008, 08:13:46 PM
I don't really understand what you are asking.

the table to run that query on is in your SMF database, and the code that I posted will change all bridged links to unbridged links.
Title: Re: Rewriting com_smf URLs to standalone URLS
Post by: forumnoob on March 11, 2008, 01:09:44 PM
I think he's looking for MOD REWRITE rules to apply, ideally with a 301 (moved code) so Google et al, stop looking for the 'old links'
Title: Re: Rewriting com_smf URLs to standalone URLS
Post by: kai920 on June 06, 2008, 01:03:14 AM
Quote from: forumnoob on March 11, 2008, 01:09:44 PM
I think he's looking for MOD REWRITE rules to apply, ideally with a 301 (moved code) so Google et al, stop looking for the 'old links'

Has anyone come up with some good htaccess rules for rewriting bridged URLs to standalone URLs?
I remember I did it the other way before, but this would be a little different.
Title: Re: Rewriting com_smf URLs to standalone URLS
Post by: kai920 on July 28, 2009, 09:37:52 PM
Kindred,

The bit of code you provided works with Joomla SEF disabled, but my URLs are of this type:

http://www.domain.com/component/option,com_smf/Itemid,71/topic,187.0

So, in addition to changing
http://www.domain.com/component/option,com_smf/Itemid,71/
to
http://www.domain.com/forums/index.php?

I also need to change topic,187.0 to topic=187.0

Any ideas how this can be achieved?

Thanks!

EDIT: nevermind, I was dumb... just need to add topic, and replace it with topic=