RE: [users@httpd] Rewrite and https

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

 



You learn stuff every day... Thanks for taking the time to fill in the gaps.

 WRT to the order in which rewrite rules are executed, you can add the following directive to the VH:

RewriteOptions inherit

Then you can add the rewrite rules that should be executed after the rewrite rules in the main server, below that.

-ascs

-----Original Message-----
From: Krist van Besien [mailto:krist.vanbesien@xxxxxxxxx] 
Sent: Thursday, August 04, 2005 11:22 AM
To: users@xxxxxxxxxxxxxxxx
Subject: Re: [users@httpd] Rewrite and https

On 8/4/05, Axel-Stéphane  SMORGRAV
<Axel-Stephane.SMORGRAV@xxxxxxxxxxxxxx> wrote:
> One thought at first: Couldn't your Weblogic server return a relative URL rather than an absolute one, i.e. a URL not containing protocol and server address ? Then this problem would not occur at all...


The problem is not only returning proper URLs but telling the weblogic server that a request came in over https.

> OK. You probably have one virtual host handling the SSL traffic, the 
> one with "SSLEngine On", right? You know that all requests handled by 
> that virtual host is HTTPS, right? So you do not need the condition 
> (RewriteCond). Why don't you just do either
> 
> Header set protocol https
> 
> or, if you absolutely want to use rewrite rules
> 
> RewriteRule ^(/[Pp]ortal.*)     $1?protocol=https       [QSA]
> 
> I think that you will have to use different Java methods to retrieve the header in the two above cases.

I am not the one that decides which java method will be used, and the powers that do decide about this have allready decided that they whant the argument "protocol=https"  added... So I have no option but to add it...

An extra problem I have is that I have about a hundred rewrite rules, and the order they are porcessed in is important. I don't know how to add a rule to the  SSL virtual host, and maintain the processing order I want. And I also don't want to maintain two complete sets of rules...

I have now found out why it wouldn't work though. This is a bug in the mod_rewrite shipped with apache 2.0. It definitely exists in 2.0.50, but has aparently been fixed now. I'll upgrade when possible. In the mean time the folowing workaround worked for me:

 # If Portal is accessed over https add a query parameter so the portal knows.
        RewriteCond     %{LA-U:ENV:HTTPS}        on
        RewriteRule ^/([Pp]ortal.*)     $1?protocol=https       [QSA]

Krist











--
krist.vanbesien@xxxxxxxxx
Solothurn, Switzerland

---------------------------------------------------------------------
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



---------------------------------------------------------------------
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