Switched to HTTPS/TLS

Thanks to Dreamhost and Let’s Encrypt, this WordPress site is now serving over HTTPS only.

Switching to HTTPS with Dreamhost and Let’s Encrypt was pretty straightforward and took about 1 hour or so at most, thanks to the nice guide by Aaron. I didn’t see some of the trouble with PHP - it might well be the case that Dreamhost has updated their default PHP configuration for hosted sites.

The procedure I took was:

  1. Update WordPress and all plugins to latest.
  2. Backup your database
  3. Enable “Secure Hosting” on Dreamhost Panel
  4. Put .htaccess with the excellent permanent redirect from http to https by Aaron:

     <IfModule mod_rewrite.c>
     # enable Rewrite
     RewriteEngine On
     # make sure not already HTTPS
     RewriteCond %{HTTPS} !=on
     # redirect from original to same location using HTTPS
     RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]
  5. Clean up database by replacing all local refs to use HTTPS using the SQL presented by Aaron (replace domainname with your own):

     UPDATE wp_comments SET comment_author_url = replace(comment_author_url, 'http://domainname.com', 'https://domainname.com');
     UPDATE wp_comments SET comment_content = replace(comment_content, 'http://domainname.com', 'https://domainname.com');
     UPDATE wp_options SET option_value = replace(option_value, 'http://domainname.com', 'https://domainname.com');
     UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://domainname.com', 'https://domainname.com');
     UPDATE wp_posts SET post_content = replace(post_content, 'http://domainname.com', 'https://domainname.com');
     UPDATE wp_posts SET guid = replace(guid, 'http://domainname.com', 'https://domainname.com');
     UPDATE wp_sitemeta SET meta_value = replace(meta_value, 'http://domainname.com', 'https://domainname.com');
  6. If possible update external references with HTTPS as well (e.g., serving Google fonts over HTTPS/HTTP)

Contents on this site are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Creative Commons License