httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jurgen <apa...@squarehosting.com>
Subject Re: [users@httpd] rewriting http to https, what am I doing wrong?
Date Thu, 30 Jan 2003 14:09:02 GMT
Hi,

for a quick solution you could use the environment variables SERVER_PORT or SERVER_PROTOCOL
in a rewrite condition.
i.e. RewriteCond %{SERVER_PORT} 443

Jurgen


On Thu, 30 Jan 2003 13:21:44 +0000
Bill Dossett <bd@emtex.com> wrote:

> Ya, you know that's what I thought, but I'm not actually
> using virtual hosts... well, half way I guess, I have
> a virtual host in the ssl.conf but I don't have any
> virtual hosts in the httpd.conf, just the one so far...
> guess I need to set up the virtual hosts bit as I do
> need to do that anyway.. and probably move the doc root
> for the https to ir.. though I think there may be more
> dirs that I want to use ssl on eventually, thanks
> for the ideas.
> 
> 
> Bill
> 
> 
> Boyle Owen wrote:
> >>-----Original Message-----
> >>From: Bill Dossett [mailto:bd@emtex.com]
> >>I am using this rewrite:
> >>
> >><Location /ir>
> >>    AllowOverride FileInfo Indexes AuthConfig Limit
> >>    DirectoryIndex index.cgi
> >>    RewriteEngine on
> >>    RewriteRule ^.*/ir(.*)$ https://%{SERVER_NAME}/ir$1 [NS]
> >></Location>
> >>
> >>and it is in my /etc/httpd/conf/httpd.conf
> >>
> >>file and that is the only place that it lives...
> >>
> >>but when I access http://www.emtex.com/ir
> >>
> >>it just goes into a loop....
> > 
> > 
> > It depends where the <Location> block is. If it is at server config
> > level (i.e. outside the VHs) then it will apply to both the HTTP and
> > HTTPS VH so no wonder you go into a loop.
> > 
> > Try putting it entirely inside the HTTP VH. In fact, just move the
> > rewrite rule there. You don't need <Location> because the rewrite rule
> > takes care of the pattern-matching on its own.
> > 
> > By the way, it sounds like your HTTP and HTTPS sites have the same
> > DocRoot - do they? It might make more sense to have the HTTPS DocRoot =
> > HTTP_DR/ir then map http://server/ir directly to https://server/.
> > 
> > Rgds,
> > 
> > Owen Boyle  
> > 
> > 
> > 
> >>I've turned logging on, but that just shows the steps
> >>of the loop it is going thru in more detail... I guess
> >>I've missed something, but I can't seem to see what.
> >>
> >>This is pretty much my first attempt at a rewrite rule,
> >>but I am unclear as to why it loops.  I have tried the
> >>NS flag as I am using index.cgi but that didn't stop the
> >>loop nor did using the [L] flag.  The rewriting is working
> >>as I can see it in the log, but I need it to stop after
> >>the first rewrite.
> >>
> >>Thanks
> >>
> >>Bill Dossett
> >>
> >>
> >>---------------------------------------------------------------------
> >>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
> >>
> >>
> > 
> > 
> > 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
> 
> 
> 
> ---------------------------------------------------------------------
> 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

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