Redirect http to https

Once you've got your SSL certificate installed, you'll want to switch your site traffic from http to https.

Firstly, configure your CMS! This is the most important step. Whether you're using Wordpress, Joomla, Drupal, SilverStripe, Magento, PrestaShop... make sure you configure it to https:// FIRST.

Then, open up (or create) your .htaccess file inside /public_html/ and paste the following right at the top:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Apache configuration for receiving reverse-proxied SSL traffic

Many customers use SSL-terminating reverse proxies and load balancers in front of their Apache...

Apache 2.4 .htpasswd protection and whitelisting multiple IP addresses

A customer asked us to secure their development environment using .htaccess and .htpassword...

Optimise cPanel PHP-FPM performance

Activating a PHP-FPM pool for your cPanel domain will give a hefty performance boost over the...

Nginx-like "microcaching" using Apache mod_cache

Nginx is well known for its high performance 'microcache' feature, which is often used to make...

Apache non-www to www .htaccess redirect

We need to redirect all of our http://example.orgĀ URLs to http://www.example.orgĀ URLs instead....