RewriteEngine On
#attachments
RewriteCond %{QUERY_STRING} attachmentid=([0-9]+)(&|$)
RewriteRule attachment\.php$ http://yoursite.com/attachments/%1? [R=301,L]
#forums
RewriteCond %{QUERY_STRING} f=([0-9]+)(&|$)
RewriteRule forumdisplay\.php$ http://yoursite.com/forums/%1? [R=301,L]
#users
RewriteCond %{QUERY_STRING} u=([0-9]+)(&|$)
RewriteRule member\.php$ http://yoursite.com/members/%1? [R=301,L]
#threads
RewriteCond %{QUERY_STRING} t=([0-9]+)(&|$)
RewriteRule printthread\.php$ http://yoursite.com/threads/%1? [R=301,L]
#posts
RewriteCond %{QUERY_STRING} p=([0-9]+)(&|$)
RewriteRule showpost\.php$ http://yoursite.com/posts/%1? [R=301,L]
#archives
RewriteRule archive/index\.php/t-([0-9]+)\.html$ http://yoursite.com/threads/$1 [R=301,L]
RewriteRule archive/index\.php/f-([0-9]+)\.html$ http://yoursite.com/forums/$1 [R=301,L]
RewriteRule ^archive/index\.php/t-([0-9]+)-p-([0-9]+)\.html$ forums/threads/$1/page-$2 [R=301,L]