How to redirect HTTP traffic to HTTPS ?

Started by Dipak Bhoi, August 31, 2014, 05:33:12 PM

Previous topic - Next topic

Dipak Bhoi

Hello guys,

In this post I covered that how to How to redirect HTTP traffic to HTTPS using cPanel and .htaccess file.

How can I Redirect URLs in cPanel ?

Login your cpanel

1. Click the Redirects icon on under the "domains" section.

2. Enter the address of the web page to move in the first field.

3. Enter the redirection address in the second field.

4. Choose one of the following options in the list:
*Temporary or *permanent

5. Click the Add button.

How to Redirect using .htaccess ?

The below code when added to an .htaccess file then it will automatically redirect any traffic for http:// to https://

Code :

QuoteRewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Hope this post will help you.

Enjoy !!!
MilesWeb - 30-Day Money Back
cPanel Web Hosting - cPanel Hosting in India
Grab a Free SSL for your website.  WordPress Optimized Solution.