match url into $ with ^(.*)/topic-(.+)\.html\?*(.*)$
if matched then
set url = $1/portal.php?mod=topic&topic=$2&$3
endif
match url into $ with ^(.*)/article-([0-9]+)\.html\?*(.*)$
if matched then
set url = $1/portal.php?mod=article&articleid=$2&$3
endif
match url into $ with ^(.*)/forum-([0-9]+)-([0-9]+)\.html\?*(.*)$
if matched then
set url = $1/forum.php?mod=forumdisplay&fid=$2&page=$3&$4
endif
match url into $ with ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$
if matched then
set url = $1/forum.php?mod=viewthread&tid=$2&extra=page\%3d$4&page=$3&$5
endif
match url into $ with ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$
if matched then
set url = $1/forum.php?mod=group&fid=$2&page=$3&$4
endif
match url into $ with ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$
if matched then
set url = $1/home.php?mod=space&$2=$3&$4
endif
match url into $ with ^(.*)/([a-z]+)-(.+)\.html\?*(.*)$
if matched then
set url = $1/$2.php?rewrite=$3&$4
endif