RewriteCond %{REQUEST_URI} !^/main.php(\?.*)?$ RewriteCond %{REQUEST_URI} ^(.*)$ RewriteRule .? /main.php?t=%1 [NE]