Rewriting com_smf URLs to standalone URLS

Started by desquinn, January 25, 2008, 10:57:50 PM

Previous topic - Next topic

desquinn

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

Kindred

do the reverse of the database change that Goosemoose provided (listed in the combines readme thread)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

desquinn

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 :)




Kindred

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?")
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

desquinn

Just realised I forgot to say thanks for this help.

cheers.

arillas

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,


Kindred

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.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

forumnoob

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'

kai920

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.

kai920

#9
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=

Advertisement: