Page 1 of 1

Avoid landing page redirect

Posted: Sat Nov 11, 2017 8:20 pm
by Rainforest
So, I'm doing some maintenance on my sites and am going crazy trying to figure this out.
Google and a redirect mapper are saying I Have 2 redirects

http://non-www to https://non-www
http://www. to https://www


My oc 2.3.0.2 site which runs full SSL and the preferred version is www.
It also runs behind a firewall with HSTS enabled

In my htaccess I have this:

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$ [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

my config.php files all list
https://www.mysite.com/whatever-link

I can't figure out what's going on to get rid of that speedtest warning

Re: Avoid landing page redirect

Posted: Sun Nov 12, 2017 6:26 am
by IP_CAM
Well, you could try this .htaccess rewrite Function instead of yours,
it's probably this, what's creating the problem:

Code: Select all

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$ [NC]
Ernie

Code: Select all

#Force (http host) non www to www (optional)
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTPS_HOST}/$1 [R=301,L]

#Force (https host) non www to www (optional)
RewriteCond %{HTTPS} on
RewriteCond %{HTTPS_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTPS_HOST}/$1 [R=301,L]

Re: Avoid landing page redirect

Posted: Tue Nov 14, 2017 6:14 am
by Rainforest
Thank you, Earnie.
Unfortunately, that didn't work.
I ended up breaking my site.
Just got a blank screen.
In the address bar was

https://www./