The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
41 views

Replace an existing environment variable in apache

I'm trying to change the value of Apache's built-in environment variable (eg. SERVER_ADDR), but neither of the following configurations has any effect: Setenv SERVER_ADDR 1.2.3.4 SetenvIf ...
0
votes
0answers
40 views

How can I use `SetEnvIf` to clear an Apache2 environment variable?

In my apache2 configuration I've got these lines: SetEnv log_everything # Create the environment variables based on access requests SetEnvIf Request_URI "^/orders/.*$" download_access ...
1
vote
2answers
703 views

How do you use Apache SetEnvIf with cookie values?

I'm trying to control apache based on cookie values, but I can't seem to get SetEnvIf to work with HTTP_COOKIE. I've boiled this down to some simple logic to isolate the issue and be easy to test. ...
0
votes
0answers
123 views

Check HTTP response header (Content-Type) and set environment variable?

I want to do a very simple job: check the Content-Type value in the response header and if the value is 'image' then set a particular environment variable. I tried this: SetEnvIf Content-Type ...
1
vote
0answers
90 views

Apache mod_setenvif match against port

To avoid duplicating several virtualhost configs I need to set an environment variable if the port of the request is 81. But I'm more than a little surprised to find that the mod_setenvif ...
1
vote
2answers
374 views

How to escape spaces in Apache SetEnvIf value

I am trying to use SetEnvIf (Apache2, via a .htaccess file) to store an environment variable where the value to be assigned to the variable needs to contain spaces. For example, trying to set ...
2
votes
1answer
293 views

Intermittent 403 errors when using allow to limit access to url with both explicit IP and SetEnvIf

We are running Apache 2.2.22 on a Solaris 10 environment. We have a specific URL that we want to limit access to by IP. We recently implemented a CDN and now have the added complexity that the IP's ...
1
vote
0answers
186 views

SetEnvIf unset variable not working

I would like Apache (version 2.2.3) to log according to the following rules: Do not log internal calls to self (127.0.0.1). Log access to /provisioning/ to provisioning_log. Log access to other ...
0
votes
0answers
788 views

Apply SetEnvIf after Apache RewriteRule

I have a working apache rewrite rule: RewriteCond %{HTTP_HOST} ^.*foo.com RewriteRule (.*) http://bar.com$1 [R=301,QSA,L] and some working dontlog SetEnvIfs: SetEnvIf Host "allrecallsapp.com" ...
1
vote
0answers
666 views

Is there if-then-else logic available for Apache environment variables?

I'm trying to set various types of mobile-specific configuration based on environment variables. The psudocode (psudoconfig) I was trying to do was something like: <if environment variable = ...
0
votes
3answers
591 views

Apache setenvif across all vhosts

To address the current apache vulnerability (CVE-2011-3192) I am trying to mitigate with setenvif as referenced here. Is there any way to have this apply to all the virtual hosts instead of adding ...
1
vote
1answer
967 views

Accessing HTTP response in Apache Rewrite/SetEnvIf (content type, expires headers)?

Is it possible to access response object data in Apache SetEnvIf RewriteCond ... so that one could manipulate headers based on content type and caching output? From the documentation it seems ...
1
vote
1answer
377 views

Apache - htaccess - prepending a php file depending on the referer

So on an Apache bundled with PHP as a module, I want to prepend a file if referer is x. This is what I have so far: <IfModule mod_setenvif.c> SetEnvIf Referer ...
1
vote
1answer
2k views

How can I use SetEnvIf to set a variable based on the Http Host?

I'm trying to set a variable on Apache ENV=DEV if the http host is the dev URL or ENV=PRD if the http host is the prd URL and then use $_SERVER['ENV'] to create some logic branches So far none ...
1
vote
1answer
1k views

SetEnvIf regex for setting Content-Disposition HTTP header

I am attempting to use the IHS 7.0/apache 2.2 SetEnvIf directive to set the filename of a downloaded file based on a url parameter. I think I am pretty close, however if there is a space (encoded or ...
3
votes
1answer
1k views

Conditionally set an Apache environment variable

I would like to conditionally set the value of an Apache2 environment variable and assign a default value if one of the conditions is not met. This example if a simplification of what I'm trying to ...
0
votes
1answer
618 views

Conditional Directory Index In Htaccess

This relates to the question in: http://stackoverflow.com/questions/1599717/conditional-directoryindex-in-htaccess The answer states that the following should work: SetEnvIf Remote_Addr ...