Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i am trying to have all sites come up as site.php instead of site.php?abc=1...etc

currently my .htaccess file reads:
RewriteCond %{QUERY_STRING} .+
RewriteRule ^(.*)$ /$1? [R=301,L]
Options -Indexes
But this is not working. Any help would be appreciated

share|improve this question

This works:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} .+
RewriteRule ^(.*)$ /site.php? [R=301,L]

Tested with apache2

share|improve this answer

For every page (not only "site.php"), you can use

RewriteCond %{QUERY_STRING} .
RewriteRule (.*) $1?
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.