Skip to content

Instantly share code, notes, and snippets.

@joshhartman
Forked from anonymous/.htaccess
Created October 24, 2015 15:44
Show Gist options
  • Save joshhartman/2c5ce661ff38b32070e5 to your computer and use it in GitHub Desktop.
Save joshhartman/2c5ce661ff38b32070e5 to your computer and use it in GitHub Desktop.
SSL Proxy Redirect to HTTPS (compatible with Network Solutions web hosting)
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
@cliff-e11group
Copy link

I tried the .htaccess route and was unsuccessful. I was able to get it working with a plugin though:

  1. Upload your site, but don’t install your certificate immediately.
  2. Do not force SSL via wp-config.php
  3. Make sure the siteurl and home variables in your wp_options table are both using http:// not https://
  4. Install the free version of the Really Simple SSL plugin https://wordpress.org/plugins/really-simple-ssl/
  5. Activate the plugin
  6. It should prompt you to update your wp-config with the following, but do it either way:

//Begin Really Simple SSL Server variable fix
$_SERVER["HTTPS"] = "on";
//END Really Simple SSL

  1. Enable your SSL certificate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment