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

The code below builds a url in this form.

and here is the rewrite cond and rule

RewriteCond %{QUERY_STRING} ^pid=([0-9]+)
RewriteRule browse/(.*)/$ show_products.php?department=$1&pid=%1 

What i would like is to have 2 extra parameters the first is order buy and the second which isn't necessarily in the url which would be filter so the url would be like this

or with parameter filter

How do I have my rewrite condition and my rewrite rule

share|improve this question
up vote 1 down vote accepted

You can add the existing query string to your request using the QSA flag (query string append). Since in your case you aren't actually changing the parameters you can do it a lot simpler:

RewriteRule browse/(.*)/$ show_products.php?department=$1  [QSA]

This will rewrite





share|improve this answer
Thanksyou for you're help. That did the trick cheers – ONYX Apr 6 '13 at 22:01

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.