[users@httpd] RewriteRule and Environment variables...

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

 



Hi,

Robert Ionescu wrote:
Neil A. Hillard wrote:
Hi,

I've been bashing my head against the wall with this problem for a while now and apart from a headache haven't really got anywhere.

I currently have Apache (2.0.54 but I've tried 2.0.55), built from source, running as an accelerator to several backends. Without getting too deep into how I'll be using it, I'm essentially trying to do:

SetEnv PROTO http

Try to use the module mod_setenvif instead of mod_env. As said in the manual (mod_env):
|Summary
|
|This module allows for control of the environment that will be provided |to CGI scripts and SSI pages.

I couldn't spot an easy way of using SetEnvIf to determine whether the request had come in using http or https, so I've used mod_rewrite to do it:

RewriteRule     .* - [E=PROTO:http]
RewriteCond     %{HTTPS} on
RewriteRule     .* - [E=PROTO:https]

I can then use %{ENV:PROTO} in any subsequent RewriteRules.

This appears to be working as desired.


				Neil.

--
Neil Hillard                    hillardn@xxxxxxxxx
Westland Helicopters Ltd.       http://www.whl.co.uk/

Disclaimer: This message does not necessarily reflect the
            views of Westland Helicopters Ltd.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
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