Configuring SSL (htaccess etc)

To move an existing http site to https

  1. Make a backup !!!
  2. Purchase SSL certificate and get hosting provider to install it, test with https://www.ssllabs.com/ssltest/index.html
  3. In WP general settings, set both urls to https://
  4. Add to the top of htaccess file in the sites top level (not /wp) folder (and no .htaccess file is needed in /wp):
    1. # Redirect http to https
    2.  
    3. RewriteEngine On
    4. RewriteBase /
    5. RewriteCond %{HTTPS} !=on
    6. RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
    # Redirect http to https
    
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTPS} !=on
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
  5. Look for ‘http:/’ in parent and child themes
  6. hardcoded http: in DB is OK in <a> links, but not in src= elements.  This causes the lack of lock icon on those pages.  Bad URL can be in the posts table, post_meta table [custom fields, gravity forms confirmations] and options table [widget settings].   In case useful, here are example queries to find culprit URLs:
    1. SELECT *  FROM `wpress_posts` WHERE `post_content` LIKE '%src="http:/%' AND post_status = "publish"`
    SELECT *  FROM `wpress_posts` WHERE `post_content` LIKE '%src="http:/%' AND post_status = "publish"`
    1. SELECT *  FROM `wpress_postmeta` WHERE `meta_value` LIKE '%src="http:/%'
    SELECT *  FROM `wpress_postmeta` WHERE `meta_value` LIKE '%src="http:/%'

    Use DB search/replace tool (more) to fix database entries. Ex: settings:

  7. old URL: http://mfmdomc.org

    new URL: https://mfmdomc.org

     

    Check all URLS, but dont check update GUIDs

    Use Dry Run feature first.

     

  8. Test All Pages. Check for grey lock icon next to URL in Safari, and Green lock in Chrome
    • ronarons.com
    • www.ronarons.com
    • http://ronarons.com
    • https://ronarons.com
    • http://www.ronarons.com
    • https://www.ronarons.com
    • http://ronarons.com/subpage
    • https://ronarons.com/subpage
  9. test that http:// URLs go to https://
  10. To inform Google about the change in URL, re-add your WordPress site to Google webmaster tools (but this time with https://) and follow this guide to let Google know about the change of URL.