RewriteEngine On RewriteRule ^f([0-9]+)-([A-Za-z0-9\-]+)\.html$ forumdisplay.php?f=$1 [L] RewriteRule ^t([0-9]+)(((-p)([0-9]+))?)([A-Za-z0-9\-]+)\.html$ showthread.php?t=$1&page=$5&pp=10 [L]