开发者

Modrewrite regex

I h开发者_如何学运维ave 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.


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜