Forum Moderators: phranque

Message Too Old, No Replies

rewriting old forum URLs

mod rewrite old forum urls to new ones using htaccess

         

misterlee

4:22 am on Jun 25, 2007 (gmt 0)

10+ Year Member



Hi all,

I hope there is a fairly simple answer for this...Basically I used SMF forum in a bridged Joomla! CMS environment and my URLs looked like this:

http://www.example.com/component/option,com_smf/Itemid,183/topic,5800.0

but now that I run SMF standalone they look like this:

http://www.example.com/community/index.php/topic,5800.0

So essentially, I'd like to replace all instances of

http://www.example.com/component/option,com_smf
to:
http://www.example.com/community/index.php

I have performed a find/replace on my database so internally I should be okay, but I'm worried about incoming URLs. Any help is certainly appreciated.

Thanks!

[edited by: jdMorgan at 4:28 am (utc) on June 25, 2007]
[edit reason] example.com [/edit]

jdMorgan

4:27 am on Jun 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sounds like you're two-thirds of the way there, then. {url=http://www.webmasterworld.com/forum92/6079.htm]This thread[/url] describes the entire process, and all you'll need to do is the final step -- Redirecting old 'unfriendly' links to the new static-looking ones in order to clean up search engine listings and handle old links and bookmarks.

Jim

misterlee

4:45 am on Jun 25, 2007 (gmt 0)

10+ Year Member



Thanks!

I've read that a few times over already and this is just greek to me.

#
# Internally rewrite search engine friendly static URL to dynamic filepath and query
RewriteRule ^product/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/?$ /index.php?product=$1&color=$2&size=$3&texture=$4&maker=$5 [L]
#
# Externally redirect client requests for old dynamic URLs to equivalent new static URLs
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\?product=([^&]+)&color=([^&]+)&size=([^&]+)&texture=([^&]+)&maker=([^\ ]+)\ HTTP/
RewriteRule ^index\.php$ http://example.com/product/%1/%2/%3/%4/%5? [R=301,L]

misterlee

6:11 am on Jun 25, 2007 (gmt 0)

10+ Year Member



For anyone else returning with this question, I was able to solve by using the following:

RewriteRule ^component/option,com_smf\/(.*) [yourdomain.com...] [R=301,L]