I need to redirect old urls of an SMF forum system to new Xenforo. Old url is :
http://www.example.com/forum/index.php?topic=XXXX.0
and new url is :
http://www.example.com/forum/threads/XXXX/
What is the true htaccess code?
This should work, though it does assume that your threads have the same ID in both SMF and XF. It should be placed before Xenforo's redirects.
RewriteCond %{QUERY_STRING} ^topic=(\d+).*$
RewriteRule ^index\.php$ http://www.example.com/forum/threads/%1/? [R=302,L]