views:

7

answers:

1

Embarrassing as this may be, I've hit a wall with mod_rewrite trying to come up with what seems to be a simple rule.

I'd like to accomplish the following mapping:

/cat/subcat which may have a "?PageId=123" afterwards

should become

/cat.php?cid=148 or (/cat.php?cid=148&PageId=123)

So for example, the following 2 mappings would occur:

/cat/subcat => /cat.php?cid=148 (the 148 part can be ignored, it's taken care of)

/cat/subcat?PageId=2 => /cat.php?cid=148&PageId=2

Note that there's an & in the second clause... The parameter will always be PageId

Can this be done?

Thanks so much in advance!

A: 

Apparently a little elbow grease worked (after 5 hours)...

Ends up the rule is just:

^/cat/subcat /cat.php?cid=148 [QSA]

I was missing the QSA component...

-Adam

AdamW