Skip to Content.
Sympa Menu

unclug - Re: [unclug] Redirect 80 ---> 443 with Apache?

unclug AT lists.ibiblio.org

Subject: UNC Linux Users Group

List archive

Chronological Thread  
  • From: Jeff Bollinger <jeff01 AT email.unc.edu>
  • To: unclug AT lists.ibiblio.org
  • Subject: Re: [unclug] Redirect 80 ---> 443 with Apache?
  • Date: Fri, 06 Feb 2004 11:45:10 -0500

Jeff Bollinger wrote:
I am setting up an Apache 2.0.48 webserver and when anyone makes a request to http://sitename, I want it to automatically redirect to https://sitename. Do I have to use mod_rewrite for this, or can I just alter some other directive (Listen??)

Thanks!
Jeff


Thanks for all the replies. For posterity, here's how you redirect all connections to an Apache server to SSL (https):


make sure mod_rewrite is loaded:

LoadModule rewrite_module modules/mod_rewrite.so

and add this to your httpd.conf file:

RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R,NC]

Jeff





Archive powered by MHonArc 2.6.24.

Top of Page