httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] specifying https-specific directives
Date Wed, 05 Jul 2006 07:03:40 GMT
> -----Original Message-----
> From: mortee [mailto:mortee.lists@kavemalna.hu] 
> Sent: Tuesday, July 04, 2006 8:02 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] specifying https-specific directives
> 
> 
> Thanks. You mean mod_ssl's %{HTTPS} variable, right?
> 
> And how do I use it to drive conditional directives? Since %{HTTPS}
> always exists, with a value "no" or "yes" (according to what 
> you wrote),
> I can't use it directly with the "Allow from env=..." form, 
> because that
> checks for the existence of the referred variable. I don't seem to be
> able to use it in SetEnvIf either - it just doesn't provide 
> the expected
> result.

You might be able to use it in a RewriteCond directive. You would need then to craft a clever
RewriteRule to get the result you want (eg, proxy back to an alias URL...) 

> 
> So what's the common practice to specify conditional 
> directives based on
> env. variables, or at least use the "Allow from env=..." form with an
> always-existing variable

The apache config file is just that - a file. It is not a programming language so doesn't
really have the syntax for the if-then-else type of construct you want. Playing around with
ENVs and RewriteConds gives you limited functionality but doesn't cover all the bases.

As others have stated, your problem might be that you are trying to impose a particular regime
when the syntax doesn't readily support it. The simplest solution is just to copy the Directory
block into each VH with different directives in each case.

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 




> 
> thx
> mortee
> 
> Boyle Owen wrote:
> > YOu can put a Directory block at server config level, ie, 
> outside all
> > VHs. Then it applies globally. As regards making the directives
> > conditional on the protocol used, you could use mod_rewrite - it has
> > a built-in environment variable, %{HTTPS} that is "on" or "off"
> > depending on whether HTTPS was used.
> 
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
Diese E-mail ist eine private und persönliche Kommunikation. Sie hat keinen Bezug zur Börsen-
bzw. Geschäftstätigkeit der SWX Gruppe. This e-mail is of a private and personal nature.
It is not related to the exchange or business activities of the SWX Group. Le présent e-mail
est un message privé et personnel, sans rapport avec l'activité boursière du Groupe SWX.
 
 
This message is for the named person's use only. It may contain confidential, proprietary
or legally privileged information. No confidentiality or privilege is waived or lost by any
mistransmission. If you receive this message in error, please notify the sender urgently and
then immediately delete the message and any copies of it from your system. Please also immediately
destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail communications through their
networks. Any views expressed in this message are those of the individual sender, except where
the message states otherwise and the sender is authorised to state them to be the views of
the sender's company.

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message