Apache method to redirect to SSL

Apache method to redirect to SSL

Post by Rob Pett » Wed, 08 Jan 2003 10:30:23



Hello,

Pardon my ignorance... I am but a beginner with Apache.

I added the following to my .htaccess within my SSL virtual hosts root:
<IfModule mod_ssl.c>
SSLRequireSSL
</IfModule>

Problem is it gives a 403 error if you try to access without SSL.  (Probably the way SSLRequireSSL is supposed to work.  Can I force
a redirect to https within my .htaccess without the unnecessary 403 error?

Thanks!

 
 
 

Apache method to redirect to SSL

Post by Joachim Ri » Wed, 08 Jan 2003 21:51:45


Quote:> Problem is it gives a 403 error if you try to access without SSL.  (Probably the way SSLRequireSSL is supposed to work.  Can I force
> a redirect to https within my .htaccess without the unnecessary 403 error?

Rewri*gine On
RewriteCond %{SERVER_PORT} !443
RewriteRule (.*) https://your_host:port$1 [R]

joachim

 
 
 

1. Apache+ssl: Invalid method in request

We have Apache 1.3.12 with mod_ssl-2.6.1-1.3.12, and secure and non-secure
web server running on the same Solaris box.  The SSL had been working fine
for weeks before the system rebooted a couple of days ago.  Now, we
couldn't connect to the secure server, and the following is the error
message it logged into the error_log:

        [error] [client x.x.x.x] Invalid method in request C
        [error] [client x.x.x.x]Invalid method in request F

and for the access_log, its says:

        - - [24/Mar/2000:11:04:51 -0800] "F" 501 -

Do you know what could be the problem here?  We did start and stop the
secure server before with the system up and running with no ill effects.
Now, does it mean that we need to test the secure server with a system
reload as well?

--

ISD USC, Los Angeles, CA 90089-0251

2. Will Linux go bankrupt?

3. Question: Running Apache SSL and Apache non-SSL on one server

4. SAS on the SP2

5. Forcing a redirect to ssl on Apache 2.0

6. Newly compiled Redhat 2.0.35 kernel will not boot. Why????

7. SSL redirects with ProxyPass in Apache?

8. /usr/bin missing files

9. Apache SSL & Redirecting http

10. Detection or redirect with Apache-SSL

11. Apache Problem: Method POST Method Not Implemented

12. Apache-SSL won't compile: Can't find ssl.h!

13. Apache-ssl or mod-ssl?