Re: Problem when mixing RewriteRules and <Location> directives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hold on, it should be SetEnvIf and not SetenvIf in your stanza!

On Mar 23, 2012 8:50 AM, "Igor Cicimov" <icicimov@xxxxxxxxx> wrote:

"The problem I'm facing here seems to rely in the fact that the variables I'm trying to use (like "THE_REQUEST", for example) are only defined within mod_rewrite's scope, and are not available to other directives like SetenvIf."

And i dont think this is correct i have used SetEnvIf with REQUEST_URI before.

On Mar 23, 2012 8:47 AM, "Igor Cicimov" <icicimov@xxxxxxxxx> wrote:

Do you have SetEnvIf and Location togather in the config? Remove the Location one and leave the SetEnvIf only to catch the env var for the header. I read somewhere a case when LocationMatch was affecting SetEnvIf.

On Mar 23, 2012 1:26 AM, "Bruno Tréguier" <Bruno.Treguier@xxxxxxx> wrote:
Le 22/03/2012 11:11, Igor Cicimov a écrit :
Why don't you just do it this way:

RewriteCond %{REQUEST_URI} !^/(media|skin|js)/ [OR]
RewriteCond %{REQUEST_URI} !^/onlinestore/checkout
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L]

and solve your rewrite problem?

Because the path /onlinestore/checkout is not an exception to the rule, and also has to be dealt with by the "index.php" catch-all script.

I just want to conditionally set a header in the HTTP response, based on the original URI, before it is fiddled with by rewriting process.

The problem I'm facing here seems to rely in the fact that the variables I'm trying to use (like "THE_REQUEST", for example) are only defined within mod_rewrite's scope, and are not available to other directives like SetenvIf.

Regards,

Bruno

--
- Service Hydrographique et Oceanographique de la Marine  -  DMGS/INF
-  13, rue du Chatellier -  CS 92803  - 29228 Brest Cedex 2, FRANCE
-     Phone: +33 2 98 22 17 49  -  Email: Bruno.Treguier@xxxxxxx

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux