Sefam
Sefam

Reputation: 1773

Too many capture groups htaccess RewriteRule

&property_type=$1&sell_type=$3&area1=$7&area2=$9&price=$11&page=$12

I'm having an issue with capture groups in a RewriteRule. $11 becomes $1's value and 1. So let's say $1 is "house", $11 ends up being "house1". Is there a way to force htaccess to get the 11th capture group rather than the first one?

Upvotes: 1

Views: 96

Answers (1)

Rounin
Rounin

Reputation: 29511

Do you need all 12 capture groups?

If not you can deploy non-capturing groups (specifically intended to help you conserve backreferences).

Where the syntax for a capture group is:

(REGEX_HERE)

the syntax for a non-capturing group is:

(?:REGEX_HERE)

Upvotes: 1

Related Questions