Hi. My goal was: if URI contains cuckoo, no matter what cookies, then
show /index.php. Otherwise if the user hasn't got BREEZESESSION cookie
set, then show /set_cookie.php.

I've got it working inside <VirtualHost> but outside <Directory>:
<VirtualHost *:80>
    ServerAdmin [EMAIL PROTECTED]
    DocumentRoot
"/Users/peterk/demo_project/connect.mytbwa.com/test/proxy.server"
    ServerName proxy.server
    ErrorLog "/private/var/log/apache2/proxy.server-error_log"
    CustomLog /private/var/log/apache2/proxy.server-access_log common
        RewriteLog "/private/var/log/apache2/proxy.server-rewrite_log"
        RewriteLogLevel 9
        
     <Directory
"/Users/peterk/demo_project/connect.mytbwa.com/test/proxy.server">
         Order allow,deny
         Allow from all
        </Directory>
                   RewriteEngine on
                
                   RewriteCond %{REQUEST_URI} cuckoo [nocase]
                   RewriteRule (.*) /index.php?%{QUERY_STRING} [L]

                   RewriteCond %{HTTP_COOKIE} !BREEZESESSION [nocase]
                   RewriteRule (.*) /set_cookie.php?$1 [L]
        
</VirtualHost>

But I couldn't get it work inside <Directory> - the config below. If I
request /cuckoo with no cookie, then I get /set_cookie.php. The
rewriter log says it rewrites to /index.php first (1st rule) and then
it rewrites it to /set_cookie.php (2nd rule). I thought [L] and [NS]
should stop any further rules. What am I missing?

I'm getting these results on Mac OS X and SUSE SLES running Apache 2,
mod _rewrite, mod_proxy and mod_php.

Best regards,
- Peter

The failing configuration:

<VirtualHost *:80>
    ServerAdmin [EMAIL PROTECTED]
    DocumentRoot
"/Users/peterk/demo_project/connect.mytbwa.com/test/proxy.server"
    ServerName proxy.server
    ErrorLog "/private/var/log/apache2/proxy.server-error_log"
    CustomLog /private/var/log/apache2/proxy.server-access_log common
        RewriteLog "/private/var/log/apache2/proxy.server-rewrite_log"
        RewriteLogLevel 9
        
     <Directory
"/Users/peterk/demo_project/connect.mytbwa.com/test/proxy.server">
         Order allow,deny
         Allow from all
                   RewriteEngine on
                
                   RewriteCond %{REQUEST_URI} cuckoo [nocase]
                   RewriteRule (.*) index.php?%{QUERY_STRING} [L]
                
                   RewriteCond %{HTTP_COOKIE} !BREEZESESSION [nocase]
                   # NS = nosubreq - made no difference in the following
                   RewriteRule (.*) set_cookie.php?$1 [NS,L]
        </Directory>
</VirtualHost>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to