Apache 2.2 mod_rewrite question

  • Thread starter Paolo Cera
  • Start date

Main Question or Discussion Point

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:
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.
 

Answers and Replies

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.
 

Related Threads for: Apache 2.2 mod_rewrite question

  • Last Post
Replies
3
Views
4K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
2
Views
13K
  • Last Post
Replies
8
Views
1K
  • Last Post
Replies
16
Views
2K
Replies
2
Views
5K
Top