Bernard Barton | 11 Oct 04:34 2007
Picon
Picon

How to redirect http to https on same server?

I'm trying to redirect users from http://vhost.mydomain.com to
https://vhost.mydomain.com using this RewriteRule:

   RewriteCond   %{SERVER_PORT}  !^443$
   RewriteRule ^/(.*)$ https://cj-mydomain.choicepoint.net/$1 [L,R]

This does not seem to work.  I have the following defined as a virtual
host, and the ssl.include is listed below that.  What do I need to do to
redirect http to https on the same server?

-Thanks

<IfDefine SSL>
    <VirtualHost 178.45.221.41:443>

        #See file below
        Include conf/conf.d/ssl.include

        ErrorLog  /usr/local/apache/logs/ssl_mydomain_error_log
        CustomLog /usr/local/apache/logs/ssl_mydomain_access_log combined

        <IfModule mod_proxy.c>
            ProxyRequests On

            ProxyPass        / http://vhost.mydomain.net:80/
            ProxyPassReverse / http://vhost.mydomain.net:80/

        </IfModule>

    </VirtualHost>
(Continue reading)

Aaron Dalton | 11 Oct 15:50 2007
Picon

Re: How to redirect http to https on same server?


Bernard Barton wrote:
> I'm trying to redirect users from http://vhost.mydomain.com to
> https://vhost.mydomain.com using this RewriteRule:

I just use:
RedirectPermanent / https://my.host.com

--
Aaron Dalton       |   Super Duper Games
aaron <at> daltons.ca   |   http://superdupergames.org
Roy Keene (Contractor | 11 Oct 16:00 2007
Picon

Re: How to redirect http to https on same server?

Bernard Barton wrote:
> I'm trying to redirect users from http://vhost.mydomain.com to
> https://vhost.mydomain.com using this RewriteRule:
> 
>    RewriteCond   %{SERVER_PORT}  !^443$
>    RewriteRule ^/(.*)$ https://cj-mydomain.choicepoint.net/$1 [L,R]
> 
> 
> This does not seem to work.  I have the following defined as a virtual
> host, and the ssl.include is listed below that.  What do I need to do to
> redirect http to https on the same server?
> 
> -Thanks
> 
> 
> <IfDefine SSL>
>     <VirtualHost 178.45.221.41:443>
> 
>         #See file below
>         Include conf/conf.d/ssl.include
> 
>         ErrorLog  /usr/local/apache/logs/ssl_mydomain_error_log
>         CustomLog /usr/local/apache/logs/ssl_mydomain_access_log combined
> 
>         <IfModule mod_proxy.c>
>             ProxyRequests On
> 
>             ProxyPass        / http://vhost.mydomain.net:80/
>             ProxyPassReverse / http://vhost.mydomain.net:80/
>           
(Continue reading)

Walls Rob Contr 75 CS/SCBS | 11 Oct 17:02 2007
Picon

RE: How to redirect http to https on same server?

I use this in the port 80 virtual host (or main section) to refer any
http request to https. The DocumentRoots should be  the same or at least
point to a similar file system structure in the http and ssl
virtualhosts. It also informs proxies that it should cache the https
version and not the http due to the 301 response code.

<Location />
	RedirectMatch 301 (.*)$ https://servername.comain$1
</Location> 

-----Original Message-----
From: owner-modssl-users <at> modssl.org
[mailto:owner-modssl-users <at> modssl.org] On Behalf Of Roy Keene
(Contractor)
Sent: Thursday, October 11, 2007 8:00 AM
To: modssl-users <at> modssl.org
Subject: Re: How to redirect http to https on same server?

Bernard Barton wrote:
> I'm trying to redirect users from http://vhost.mydomain.com to 
> https://vhost.mydomain.com using this RewriteRule:
> 
>    RewriteCond   %{SERVER_PORT}  !^443$
>    RewriteRule ^/(.*)$ https://cj-mydomain.choicepoint.net/$1 [L,R]
> 
> 
> This does not seem to work.  I have the following defined as a virtual

> host, and the ssl.include is listed below that.  What do I need to do 
> to redirect http to https on the same server?
(Continue reading)

Bernard Barton | 12 Oct 01:52 2007
Picon
Picon

Re: How to redirect http to https on same server?

Thanks for all the responses.  But no matter what I do or where I place
a Rewrite or Redirect, I get the following error in Firefox:

((("The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this
address in a way that will never complete.

This problem can sometimes be caused by disabling or refusing to accept
cookies.")))

The page is redirected from http://myserver to https://myserver, but I
get the above message.  I do have Firefox configured to accept cookies. 
When I try to access the site using IE, it just hangs.  Any suggestions
would be greatly appreciated.

Roy Keene (Contractor) wrote:
> Bernard Barton wrote:
>> I'm trying to redirect users from http://vhost.mydomain.com to
>> https://vhost.mydomain.com using this RewriteRule:
>>
>>    RewriteCond   %{SERVER_PORT}  !^443$
>>    RewriteRule ^/(.*)$ https://cj-mydomain.choicepoint.net/$1 [L,R]
>>
>>
>> This does not seem to work.  I have the following defined as a virtual
>> host, and the ssl.include is listed below that.  What do I need to do to
>> redirect http to https on the same server?
>>
>> -Thanks
(Continue reading)

Aaron Dalton | 12 Oct 01:57 2007
Picon

Re: How to redirect http to https on same server?

On Thu, 11 Oct 2007, Bernard Barton wrote:

> Thanks for all the responses.  But no matter what I do or where I place
> a Rewrite or Redirect, I get the following error in Firefox:
>
> ((("The page isn't redirecting properly
>
> Firefox has detected that the server is redirecting the request for this
> address in a way that will never complete.
>

Where are you attempting to put the RedirectPermanent directive?  I assume 
you have a plain virtual host entry for http://myhost.  In that 
<VirtualHost> container you put the RedirectPermanent / https://myhost 
(which is of course in it's own <VirtualHost> container with all the ssl 
stuff).  Can you copy your http://myhost config?

--

-- 
Aaron Dalton
Super Duper Games
http://superdupergames.org
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      modssl-users <at> modssl.org
Automated List Manager                            majordomo <at> modssl.org

Bernard Barton | 14 Oct 00:59 2007
Picon
Picon

Are text attachments permitted in mailing list?

I sent a message with an attachment several hours ago, and still have
not received a copy of it via the modssl-users mailing list.  The
message included two text attachments.  Are text attachments allowed?

-Thanks

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      modssl-users <at> modssl.org
Automated List Manager                            majordomo <at> modssl.org

Bernard Barton | 14 Oct 16:33 2007
Picon
Picon

Why are some messages not being distributed to mailing list?

I sent an email with two text attachments, and never received a copy
from the mailing list from owner-modssl-users <at> modssl.org.  So I sent a
message asking if attachments were permitted, and did receive that
message.  So, I sent another message WITHOUT attachments, but placed
copies of the httpd.conf and another .conf file withing the message.  I
have not received that message either, from the mailing list.  

Any ideas?

-Thanks

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      modssl-users <at> modssl.org
Automated List Manager                            majordomo <at> modssl.org

Bernard Barton | 16 Oct 00:32 2007
Picon
Picon

Please help with http -> https redirection

In my main httpd.conf file, I have numerous include files which include
virtual hosts like so:

Include /usr/local/apache/conf/conf.d/devl00.conf
Include /usr/local/apache/conf/conf.d/devl01.conf
Include /usr/local/apache/conf/conf.d/devl02.conf

So if I access http://devl02.mydomain.com/ then I see the virtual host
defined
in devl02.conf, etc.  In the devl02.conf file, I have enabled SSL.  I CAN
access the secure site https://devl02.mydomain.com/.  However, when I now
access the non-secure site of http://devl02.mydomain.com, the main server
web site is displayed, and not the virtual host.  What I'm trying to do
is a

   RedirectPermanent / https://cj-devl02.mydomain.net/  

But when I do this I get errors that I posted previously about cookies not
being enabled.  So I guess the questions is, having the "Include" statements
above, and knowing that each include file like devl08.conf is a virtual host
container with SSL enabled, how do I redirect from the port 80 version to
the SSL enabled port 443 version like:

http://cj-devl02.mydomain.net/  ------>  https://cj-devl02.mydomain.net/

FYI, I've tried including .conf files, and also pasting the contents of my
.conf files into an email, but they evidently are rejected by the
mailing list.

______________________________________________________________________
(Continue reading)

Cliff Woolley | 16 Oct 01:56 2007
Picon

Re: Please help with http -> https redirection


Are these IP-based virtual hosts or name-based virtual hosts?  See http://httpd.apache.org/docs/2.0/vhosts/name-based.html

--Cliff


On 10/15/07, Bernard Barton <bfb21 <at> comcast.net> wrote:
In my main httpd.conf file, I have numerous include files which include
virtual hosts like so:

Include /usr/local/apache/conf/conf.d/devl00.conf
Include /usr/local/apache/conf/conf.d/devl01.conf
Include /usr/local/apache/conf/conf.d/devl02.conf


So if I access http://devl02.mydomain.com/ then I see the virtual host
defined
in devl02.conf, etc.  In the devl02.conf file, I have enabled SSL.  I CAN
access the secure site https://devl02.mydomain.com/.  However, when I now
access the non-secure site of http://devl02.mydomain.com, the main server
web site is displayed, and not the virtual host.  What I'm trying to do
is a

   RedirectPermanent / https://cj-devl02.mydomain.net/

But when I do this I get errors that I posted previously about cookies not
being enabled.  So I guess the questions is, having the "Include" statements
above, and knowing that each include file like devl08.conf is a virtual host
container with SSL enabled, how do I redirect from the port 80 version to
the SSL enabled port 443 version like:

http://cj-devl02.mydomain.net/  ------>  https://cj-devl02.mydomain.net/

FYI, I've tried including .conf files, and also pasting the contents of my
.conf files into an email, but they evidently are rejected by the
mailing list.

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                       modssl-users <at> modssl.org
Automated List Manager                            majordomo <at> modssl.org


Gmane