RewriteEngine On RewriteRule ^([a-z]{2,4})-([a-zA-Z0-9]{3,15})/([0-9]{1,7})/$ index.php?smsite=$1&smid=$3&smtemp=$2 [L] RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]