"Define" directive is ALWAYS parsed

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

 



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:

Documentation for "If" directive (https://httpd.apache.org/docs/2.4/mod/core.html#if):
Only directives that support the directory context can be used within this configuration section.

Documentation for "Define" directive (https://httpd.apache.org/docs/2.4/mod/core.html#define):
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]

  Powered by Linux