So far I've been able to manage with mod rewrite rules for basic URL beautifying such as hiding regular browser GET requests, etc ... This time I got into trouble because a question mark in the URL leads me to a 404 error.
I have this rule:
which makes my URL look like this:
RewriteRule ^cat-(.*)$ index.php?cat=$1 [L]
Everything good so far but occasionally, to the query string is also passed a sort parameter like:
and want the rule:
Even I'm escaping the question mark, I still get the 404 page. If I am replacing the question mark with any other character, the rewrite rule works! I need it to work with the category rule alone as well with the sort parameter since it's optional but cannot get there no matter what!
RewriteRule ^cat-(.*)\?s=(.*)$ index.php?cat=$1&s=$2 [L]
I would appreciate any advice you might have.