I'm yet another person new to .htaccess files and having difficulty with it. I'm trying to have the file check for a cookie named 'path' and then see if the URI contains it. I am trying to use %1 in the correct manner to reference the cookie value later in the file and I cannot seem to make it work properly. Here is my .htaccess file:
RewriteEngine On
#checking the cookie matches successfully
RewriteCond %{HTTP_COOKIE} path=/testing/rockwell/
#checking if the URI contains %1 (the value of the cookie) fails
RewriteCond %{REQUEST_URI} %1
#a literal string match works though
###RewriteCond %{REQUEST_URI} /testing/rockwell/
RewriteRule .* http://www.example.com
What am I doing wrong with %1? I understand that it is supposed to allow me to reference a previous match in RewriteCond. I included the commented-out RewriteCond to show what I am trying do. Any help with this would be much appreciated.