How to redirect http requests to https in apache

 DocumentRoot /var/www/html
 ServerName samtz.dyndns.org
 ErrorLog logs/samtz-error_log
 CustomLog logs/samtz-access_log combined
 
  Options ExecCGI
  Options Indexes
  AllowOverride All
 

 RewriteEngine on
 RewriteCond %{SERVER_PORT} =80
 RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI}

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.