Redirect http to https in Apache

RussianRoot 23/11/2012 0

In this article I am going to show how you can redirect http to https in apache. Let’s say we have customer management software on and you would like to use it securely to prevent data stealing, so you will have to redirect your user to

So how to redirect http to https using httpd.conf or .htaccess in Apache?
First of all you will have to make sure that your Apache Webserver is configured for HTTPS connections and all necessary and correct SSL certificates are installed.

Redirect non-ssl to https

Open httpd.conf or .htaccess (Apache Module mod_rewrite is not required):
# nano httpd.conf

Add the following line :

Any request made to will be forwareded to

Save and close your config file. Restart the Webserver (Not required for .htaccess):

This is one of X ways to ensure that your user will never use plain text HTTP protocol to send sensitive login data.

This makes it much harder to sniff private data.

Leave A Response »

9 − 3 =

Warning: require_once(/www/htdocs/w00e1ca9/domainpool/ failed to open stream: No such file or directory in /www/htdocs/w00e1ca9/domainpool/ on line 48

Fatal error: require_once(): Failed opening required '' (include_path='.:/usr/share/php:..') in /www/htdocs/w00e1ca9/domainpool/ on line 48