WordPress with HTTPS on Dreamhost and CloudFlare

Today I’ve got my blog work over HTTPS, including admin. Woo-hoo! Below are the steps I used to do it.


My configuration is as follows:

  • Hosting on Dreamhost.com
  • Use CloudFlare free account
  • WordPress 4.7.1 at the time of writing


From the Dreamhost Panel, select Domains > Secure Hosting:

You’ll be presented with a panel to select the type of certificate. I chose to use Let’s Encrypt because it’s free:

Once you select Let’s Enctypt SSL, you’ll have to select the domain, accept the T&C and click Add Now:

In the Domains > Manage Domains section of the panel, your domain will have “https On” and “Certificate active”:

Now you’ll have to wait for your confirmation that HTTPS has been activated.

Tweaking WordPress

I’ve looked for several options in making WordPress available via SSL. Some suggested changing the WP_HOME and SITE_URL (hard-coding in wp-config.php) to have the https prefix. Others suggested changing the options (which are stored in the DB):

I tried both but I got HTTP 302 (which was probably the fault of my initial CloudFlare config…).

The solution that worked for me had 2 parts:

  1. Add define('FORCE_SSL_ADMIN', true) to wp-config.php
  2. prepend .htaccess with:

    This will force redirect to HTTPS

If you don’t have CloudFlare, this is the end.


To set up your CloudFlare for HTTPS, you’ll need to enter the Crypto tab for your site (red mark below):

IMPORTANT: Make sure you have a FULL SSL communication. This will make sure the communication between CloudFlare and Dreamhost is also secure. Otherwise, you’ll get the 302 I mentioned above.

Once you have the Edge certificate enabled, you should be good to go.

Note: You should be able to us the automatic HTTPS rewrites on the CloudFlare side (to avoid changing the .htaccess file on your host). It’s located at the bottom of the Crypto tab:

I personally haven’t tried it.


To get through this, I’ve got inspiration from the following sources:


A little experiment: If you find this post and ad below useful, please check the ad out :-)

3 thoughts on “WordPress with HTTPS on Dreamhost and CloudFlare

  1. Thank you. Thank you. Thank you.

    I’ve been trying to get ssl working on my website for months, with a variety of methods and hacks and all, but this post did it for me. I’ve got a bit of new lag, probably from the redirect, but everything is nice and locked up now.

    Thanks again!

  2. Thank you! I’ve been fiddling with it for long days, even opened a ticket at Dreamhost and Cloudflare.

    You information worked for me! Thank you again!!!

Leave a Reply to Bruno Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to top