htaccess

Herci
Herci used Ask the Experts™
on
I have the below htaccess rule;
RewriteRule ^(.+)-(.+)\.php?$ category.php?cdesc=$1&cid=$2

It allows me to present this link;
/Birthday-16.php

and translate to this;
category.php?cdesc=$1&cid=$2

Now I want to do the following to GET the "sorttype" and "refine" and the "page" values but don't know how to do it in the htaccess.
/Birthday-16.php?sorttype=1
/Birthday-16.php?sorttype=1&refine=10&page=12

I've tried something like this but looks like it's not correct.
RewriteRule ^(.+)-(.+)\.php?sorttype=(.+)$ category.php?cdesc=$1&cid=$2&sorttype=$3
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
Hi Experts..Can anyone please help me with this?
Hi add the following flag to the end of your rule [QSA] it stands for Query String Append. It will take any query string existent and add it to the end of your rewritten url. IE:
RewriteRule ^(.+)-(.+)\.php?$ category.php?cdesc=$1&cid=$2 [QSA]

Open in new window

Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial