XF 1.3 PHPBB3 SEO to XF 135 : Dead links :(


I try to migrate my PHPBB3 to XF.
All is ok, but a very big problem : Links : false URL or Dead :(

My htaccess :

#   Mod_security can interfere with uploading of content such as attachments. If you
#   cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
#   SecFilterEngine Off
#   SecFilterScanPOST Off

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default

<IfModule mod_rewrite.c>
   RewriteEngine On
  RewriteCond %{QUERY_STRING} (^|\?)f=([0-9]+)&t=([0-9]+)($|&)
RewriteRule ^viewtopic\.php$ /threads/%3/? [R=301,L]

RewriteCond %{QUERY_STRING} (^|\?)f=([0-9]+)($|&)
RewriteRule ^viewforum\.php$ /forums/%2/? [R=301,L]

   #   If you are having problems with the rewrite rules, remove the "#" from the
   #   line that begins "RewriteBase" below. You will also have to change the path
   #   of the rewrite to reflect the path to your XenForo installation.
   #RewriteBase /xenforo

   #   This line may be needed to enable WebDAV editing with PHP as a CGI.
   #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

   RewriteCond %{REQUEST_FILENAME} -f [OR]
   RewriteCond %{REQUEST_FILENAME} -l [OR]
   RewriteCond %{REQUEST_FILENAME} -d
   RewriteRule ^.*$ - [NC,L]
   RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
   RewriteRule ^.*$ index.php [NC,L]
Thank you for your help because I have more thant 2500 dead links :( :( :(
THX, but how do I to do ?

Where can I write by example
if ( $arg_p ) {
rewrite ^\/forum\/viewtopic\.php /forum/posts/$arg_p/? permanent;
if ( $arg_t ) {
rewrite ^\/forum\/viewtopic\.php /forum/threads/$arg_t/? permanent;
rewrite ^\/forum\/viewforum\.php /forum/forums/$arg_f/? permanent;
on my htaccess ?