Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

This works:

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

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

 
discard

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.