RewriteCond %{REQUEST_URI} !^(.*)static(.*)$ RewriteCond %{QUERY_STRING} ^(.*)(&p=1&)(.*)$ RewriteRule ^(.*)$ /$1?%1&%3 [R=301,L]