Ok, first, my code is modified for my needs and a german site, but i think you will be able to figure out the improvements for your version of the mod:
replace function:
Code:$urlin =
array(
$prefix . '(?<!/)main.php"|',
$prefix . '(?<!/)viewforum.php\?f=([0-9]*)&topicdays=([0-9]*)&start=([0-9]*)"|',
$prefix . '(?<!/)viewforum.php\?f=([0-9]*)"|',
$prefix . '(?<!/)viewtopic.php\?t=([0-9]*)&highlight=([a-zA-Z0-9\+]*)"|',
$prefix . '(?<!/)viewtopic.php\?t=([0-9]*)&view=previous"|',
$prefix . '(?<!/)viewtopic.php\?t=([0-9]*)&view=next"|',
$prefix . '(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&vote=viewresult"|',
$prefix . '(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&start=([0-9]*)"|',
$prefix . '(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&highlight=([a-zA-Z0-9\+]*)&start=([0-9]*)"|',
$prefix . '(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)"|',
$prefix . '(?<!/)viewtopic.php\?t=([0-9]*)"|',
$prefix . '(?<!/)viewtopic.php\?p=([0-9]*)"|',
$prefix . '(?<!/)viewtopic.php\?p=([0-9]*)#([0-9]*)"|',
);
$urlout = array(
"forums.html",
"viewforum\\1-\\2-\\3.html",
"forum\\1.html",
"thema\\1.html?highlight=\\2",
"ptopic\\1.html",
"ntopic\\1.html",
"thema-umfrage\\1-\\2-\\3.html",
"thema\\1-\\2-\\3-\\4.html",
"thema\\1-\\2-\\3-\\5.html?highlight=\\4",
"thema\\1-\\2.html",
"thema\\1.html",
"beitrag\\1.html",
"beitrag\\1.html#\\2",
);
.htaccess:
Code:RewriteRule ^forums.html main\.php [L,NC]
RewriteRule ^beitrag([0-9]*)\.html viewtopic.php?p=$1 [L,NC]
RewriteRule ^forum([0-9]*)\.html viewforum.php?f=$1 [L,NC]
RewriteRule ^viewforum([0-9]*)-([0-9]*)-([0-9]*)\.html viewforum.php?f=$1&topicdays=$2&start=$3 [L,NC]
RewriteCond %{QUERY_STRING} ^highlight=(.*)$
RewriteRule ^thema([0-9]*)\.html viewtopic.php?t=$1&highlight=%1 [L,NC]
RewriteRule ^thema([0-9]*)\.html viewtopic.php?t=$1 [L,NC]
RewriteCond %{QUERY_STRING} ^highlight=(.*)$
RewriteRule ^thema([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*)\.html viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4&highlight=%1 [L,NC]
RewriteRule ^thema([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*)\.html viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^thema([0-9]*)-([0-9]*)\.html viewtopic.php?t=$1&start=$2 [L,NC]
RewriteRule ^thema-umfrage([0-9]*)-([0-9]*)-([a-zA-Z]*)\.html viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^ptopic([0-9]*)\.html viewtopic.php?t=$1&view=previous [L,NC]
RewriteRule ^ntopic([0-9]*)\.html viewtopic.php?t=$1&view=next [L,NC]
If you need futher explanations, ask