Dear Wiki user, You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.
The following page has been changed by sjorge: http://wiki.apache.org/httpd/RedirectSSL The comment on the change is: beginning of cleanup work ------------------------------------------------------------------------------ === Using mod_rewrite === + There is a separate page for this located here: + ["RewriteHTTPToHTTPS"] - {{{ - <Location /secure> - RewriteEngine On - ReWriteCond %{HTTPS} !=on - RewriteRule .* https://%{HTTP_HOST}:8443%{REQUEST_URI} [QSA,R=301,L] - </Location> - }}} - - '''Note:''' This snippet can also be used inside a directory or vhost container. If the SSL port is something other than 443 (the default), you can add a : + the port number behind %{HTTP_HOST} in the RewriteRule. - - Make sure you have loaded [http://httpd.apache.org/docs/trunk/mod/mod_rewrite.html mod_rewrite] and have it enabled. - - {{{ - LoadModule rewrite_module modules/mod_rewrite.so - RewriteEngine On - }}} === Using virtual hosts === When using SSL, you will frequently have at least two virtual hosts: one on port 80 to serve ordinary requests, and one on port 443 to serve SSL. If you wish to redirect users from the non-secure site to the SSL site, you can use an ordinary [http://httpd.apache.org/docs/trunk/mod/mod_alias.html#redirect Redirect] directive inside the non-secure VirtualHost:
