I've setup a forum on the root directory and decided to move it on /forum directory. what is the best way to redirect to avoid dup content and traffic loss?
Are you wanting to put new content at / or just simply redirect everything to /forum/ and put new content there later? Also, a good known fact is that cool and good URIs don't change, which means you should always stick with the original URI structure (aka not moving). If this is your last resort then ok, but as a piece of advice, don't change URIs, ever.
Sorry, I'm not that great with mod_rewrite, but i know how to get around for small stuff. you'll want something along the lines of Rewrite /showthread.php?p=(.*) /forum/showthread.php?p=$1 or something like that. Someone else will know a lot better than I do.
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^showthread.php?p=([^.]+)$ http://www.domain.com/forum/showthread.php?p=$1 [R=301,L] RewriteRule ^forumdisplay.php?f=([^.]+)$ http://www.domain.com/forum/forumdisplay.php?f=$1 [R=301,L]