RewriteEngine on
RewriteBase /
RewriteRule ^links(.*)\.html links.php?page=$1
RewriteRule ^cat(.*)/links(.*)\.html links.php?cat=$1&page=$2