Caipiranha
Caipiranha

Reputation: 55

QUERY_STRING exact match

How do I make exact match for a partial URL, like:

page_id=11

301 to xyz.com but page_id=118 remains page_id=118

I have now RewriteCond %{QUERY_STRING} page_id=11 but it works for 118 and anything with 11 in it too.

Upvotes: 0

Views: 343

Answers (1)

anubhava
anubhava

Reputation: 785196

You can use this condition:

RewriteCond %{QUERY_STRING} (^|&)page_id=11(&|$) [NC]

Upvotes: 1

Related Questions