BIOS,Windows, Linux, Software,Security, Domains, Web Hosting

Redirect HTTP to HTTPS in Apache

If you are using HTTPS in your website, you might need to redirect http to https for most users who visit your https pages by mistype as http. mod_rewrite in apache is very easy to use. This article I will list some methods to redirect http to https, use any of them as you prefer.

1. Modify httpd.conf

<VirtualHost *:80>
Redirect /
</VirtualHost >

2. Using mod_rewrite in .htaccess

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

3. Using location or meta



<meta http-equiv="Refresh" content="0;URL=" />

Related Articles


Leave a Reply

Subscribe to BootBeta Comments RSS feed to receive notification of latest comments posted.


  • Enter Email Address:

Recent Post

Copyright@ 2010-2014 Bootbeta All Rights Reserved.
HooBlog Ver 1.5 Build 20140530