"Define" directive is ALWAYS parsed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: users@xxxxxxxxxxxxxxxx
- Subject: "Define" directive is ALWAYS parsed
- From: Adam <adam.vest@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 18 Sep 2016 11:52:27 -0400
- Reply-to: users@xxxxxxxxxxxxxxxx
Hello,
I'm working on a way of making specific content available only under certain circumstances, and I believe the best way to go about this is to use the "Define" directive, then do some stuff within "<IfDefine ...>" wrappers. The problem is, no matter what kind of conditional stuff I put around the Define line, it is always parsed.
Example:
<If "%{HTTP_USER_AGENT} =~ /curl/>
Define myvar
</If>
With the above, the "myvar" parameter will always be defined for every request, regardless of user-agent. This will also work:
<If "%{REMOTE_ADDR} == 'these.are.numbers'">
Define myvar
</If>
Very clearly that should never ever match, yet it does. Reading the documentation seems to indicate that the Define directive should be obeying the context it is being put in:
Only directives that support the directory context can be used within this configuration section.
Context: server config, virtual host, directory
Perhaps the only way I could get Define to only be applied conditionally is by following the example of nesting it within <IfDefine...> wrappers. But if Define is otherwise always set globally and unconditionally, then the <IfDefine...> directive seems superfluous.
Am I vastly misunderstanding the usage of this here?
Thanks for any assistance.
-Adam
[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]