Redirect HTTP request to HTTPS

To redirect http requests to https on your Apache web server use .htaccess and add the following rewrite rules.

RewriteEngine On
RewriteCond     %{SERVER_PORT} ^80$
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]

You can also add it inside the virtual host entry of the domain for which you need this redirect.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>