httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars <>
Subject [users@httpd] Odd htaccess mod_rewrite problem
Date Tue, 14 Aug 2007 13:17:28 GMT
Hello List

I have a problem with htaccess I cant quite figure out of.
I have a .htaccess file in /secure/ with something like this:
 RewriteEngine on
 RewriteCond %{HTTP_COOKIE} !^.*PHPSESSID=1234567890abcdef1234567890abc.*$
 RewriteRule .*$ - [F]

This sends 403 if the browser doesnt have the specified cookie (yes,
the .htaccess file is autogenerated). Anyway, this works perfectly for
every folder under /secure/. But I have one folder, /secure/forum/
that have another .htaccess file with other rewrite rules under like
 RewriteEngine on
 RewriteRule ^file-(.*)$ show-file.php?file=$1 [NC]
But here is the problem. When I have the last rule, the first cookie
check rule doesnt apply. Why? I tought that apache was checking
htaccess file like this, 1) .htaccess 2) /secure/.htaccess 3)
/secure/forum/.htaccess. Isnt that right?
I have also tried to add [L] To the first .htaccess file to make it as
the (last rule), but that doesnt work either (or did I do it wrong).
Does anyone else have any idea? I really need this thing working with
both the .htaccess files.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message