views:

19

answers:

2

I have the following URL: http://www.domain.com/keyword/b21?f=&ca1=50&p=1

And the RewriteRule I am trying to use is as follows:

RewriteRule ^([^.]+)/b([0-9]+)?f=([^.]+)&p=([0-9]+)$ script.php?id=$2&p=$2&filters=$3

Unfortunately this rule is not matching the URL.

I think it has something to do with the ? as i know this is a character used in regualr expressions.

Any help would be greatly apprecriated.

+2  A: 

I've not tested this, and I've not used a rewrite like this before myself, so it might not be exactly right.

RewriteCond %{QUERY_STRING} ^f=([^.]+)&p=([0-9]+)$
RewriteRule ^([^.]+)/b([0-9]+)$ script.php?id=$2&p=$2&filters=%1
Alex Barrett
Sorry this didnt work :(
Lizard
I've looked at the docs for you, and edited my answer to something that hopefully works (or almost works).
Alex Barrett
Thats worked great! You're a star!
Lizard
+1  A: 

I strongly suggest you redirect the URL with the full query string and process it directly in the PHP script with parse_str()

kemp