Apache 2.2 mod_rewrite question

1. Mar 24, 2008

Paolo Cera

Anyone know of the proper syntax that captures this metaphor?

Given a Cookie and URI, I would like to check for the existence of a substring in the cookie in the URI and then proceed to a rewrite rule accordingly.

Here's an example of my reasoning

Code (Text):
RewriteEngine on

...

RewriteCond %{HTTP_COOKIE},%{REQUEST_URI} .*xXx(.+)xXx.*,.*$1.* RewriteRule blah,blah,blah I would suspect something likes this is syntactically correct, but repeated testing proves me wrong. Any help would be appreciated. 2. Mar 24, 2008 Paolo Cera Got the answer to this. Turns out that I'm trying to do something called a local backreference, and the solution is only portable to POSIX 1003.2+ compliant OSes. More on it can be found here. Note, the bind name /N$ (where 0 < N < 9) did not work for me, but \N did.

Anyways, hope this doesn't trip up anyone else in the future.