RewriteEngine On RewriteBase / RewriteCond %{request_uri} !^index.php RewriteCond %{request_uri} !^test.php RewriteRule ^(.*) http://www.site.com/test.php?r=$1 [R,L] #everything goes to www.site.com/test.php?r=test.php