Monthly Archives: December 2015


Redirect http to https for a domain in Plesk 12.5

Update Apr, 2018: since PleskĀ v17.5 and higher, adding a custom http directive as mentioned in the article below isn’t required anymore. Now you can simply go to your domain in Plesk > Hosting Settings > and select the optionĀ Permanent SEO-safe 301 redirect from HTTP to HTTPS. Thank you, Plesk!

It’s a good evolution that it keeps on getting easier to add a SSL certificate to a domain. And I would certainly encourage to do so, if you have the chance. For example, when you’re using Parallel’s/Odin’s Plesk as a hosting environment it is really easy to import a SSL certificate for a specific domain.

But the thing that is not so straightforward is forcing a domain to only run https.

This is because, remarkably, there is no native setting or magic checkbox you can select to make this happen. In fact, there is currently no other way then to add a custom directive to the .htaccess or vshost configuration of the domain. So, let’s clear things up and simply make it easy, using the following instructions (applicable to the Linux variant of Plesk 12.5 only):

First, login to your Plesk instance and navigate to the appropriate domain settings. In here, select the Apache & nginx settings, which is a new option in Plesk 12.5.


On the settings page you’ll find the options to add Additional Directives for both http and https. The only thing we’re interested right now is simply redirecting all traffic from http to https. For this, we’ll simply add a rewrite rule to the http directive:
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,QSA]

Which will look like:


Hit the Apply button and all your traffic will be automatically rewritten to use https.