Take the 2-minute tour ×

I have URLS like this on a page of my website:


I would like to have something nicer, like:


Or even uglier. The important thing is removing the troublesome square brackets and changing as little as possible server-side (I use PHP).

I tried different rules with little luck. Hints?

share|improve this question
What rules did you try? –  Chen Asraf May 13 '13 at 14:45
you're not going to be able to do that very easily with mod_rewrite. regexes are powerful, but not omnicient... –  Marc B May 13 '13 at 14:58

1 Answer 1

RewriteRule stores/([\d,]+)/categories/([\d,]+)/min_price/([\d,]+)/sort/([\w\.]+)/ ?stores=$1&categories$2&min_price=$3&sort=$4 #etc

That would require you to split multiple values into an array using explode() though. Like so:

$_GET['stores'] = explode(',', $_GET['stores']);
share|improve this answer
Thanks to your input, I solved it without editing my rewrite rules. I simply changed the javascript that created the URL. Still, I'm very curious if that could be done with a dynamic url, where stores and categories could be inverted and more field could be present. –  koichirose May 13 '13 at 16:43

Your Answer


