I have this rule:
RewriteCond %{QUERY_STRING} size=(\d+)
and want to capture (\d+)
for later use in RewriteRule
or RewriteCond
. Something like this:
RewriteCond %{QUERY_STRING} size=(\d+)
RewriteCond $1 <1024 ## that $1 refers to (\d+)
How can I achieve that?
You need to use the %
backreferences:
RewriteCond %{QUERY_STRING} size=(\d+)
RewriteCond ^ /%1 [L]
The %1
backreferences a previously captured group in a rewrite cond.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With