RewriteEngine On RewriteCond %{REQUEST_URI} !main_redirect RewriteRule ^(.*)$ http://%{SERVER_NAME}/main-redirect.php?args=$1 [R,QSA]