How to force https in Apache web server

Optimizing and customizing your VPS/Dedicated server

How to force https in Apache web server

Postby Mark » Thu Dec 31, 2009 11:32 pm

Image


For this tutorial we are going to make use of apache functions mod_rewrite through the use of .htaccess file.

The idea is to force your visitors to browse your website in https secure mode so that all transaction is made secure using world standard encryption.

For this to be done create a .htaccess file using any text editor and just paste the following code.

Code: Select all

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


Using your FTP client upload this file to the root folder of your website.

If you have problems redirecting make sure your httpd.conf file includes the following:

Code:

Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so


That is all you need!
Mark
 
Posts: 124
Joined: Fri Dec 11, 2009 2:18 pm

Return to Configuring VPS/Dedicated servers

Who is online

Users browsing this forum: Ask Jeeves [Bot] and 1 guest

cron