How to redirect http to https on same server?

Bernard Barton <[email protected]>
Newsgroups gmane.comp.apache.mod-ssl.user
Message-ID <[email protected]>
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>
</IfDefine> 


###########################  ssl.include

SSLEngine on

SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

SSLCertificateFile
/usr/local/apache-1.3.37/conf/ssl.crt/star_mydomain_net.crt

SSLCertificateKeyFile
/usr/local/apache-1.3.37/conf/ssl.key/star_mydomain_net.key

SSLCertificateChainFile /usr/local/apache-1.3.37/conf/ssl.crt/DigiCertCA.crt

<Files ~ "\.(cgi|shtml|phtml|php3|roc|rock?)$">
    SSLOptions +StdEnvVars
</Files>

SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [email protected]
Automated List Manager                            [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.