-
-
Save joshhartman/2c5ce661ff38b32070e5 to your computer and use it in GitHub Desktop.
SSL Proxy Redirect to HTTPS (compatible with Network Solutions web hosting)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
I tried the .htaccess route and was unsuccessful. I was able to get it working with a plugin though:
- Upload your site, but don’t install your certificate immediately.
- Do not force SSL via wp-config.php
- Make sure the siteurl and home variables in your wp_options table are both using http:// not https://
- Install the free version of the Really Simple SSL plugin https://wordpress.org/plugins/really-simple-ssl/
- Activate the plugin
- 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
- Enable your SSL certificate
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
0
This is the ONLY Clean way to Redirect with Networksolutions. Took me hours of testing. Works best for SEO. Network Solutions is a challenging Hosting platform.
This will work .htaccess all you replace is changeexample.com with your domain. Easy.
Base Redirects
Turn on Rewrite Engine
RewriteEngine On
Remove trailing slash from non-filepath urls
RewriteCond %{REQUEST_URI} /(.+)/$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ https://changeexample.com/%1 [R=301,L]
Include trailing slash on directory
RewriteCond %{REQUEST_URI} !(.+)/$
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+)$ https://changeexample.com/$1/ [R=301,L]
Force HTTPS and remove WWW
RewriteCond %{HTTP_HOST} ^www.(.)$ [OR,NC]
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.)$ https://changeexample.com/$1 [R=301,L]
Best of Luck! This is current as of 05/14/2021