After turning on CF at SiteGround, I am getting two redirects on the website rootname as in “taastrategies.com”. This is the part of the .htaccess which appears to be relevant to preventing/minimizing redirects:
# BEGIN HTTPS - added by SiteGround support on 04/17/18
# force https:// (and add www prefix) in a single redirection
# prevent 'chained redirects' reducing 'TTFB' and improving scores
RewriteCond %{HTTPS} !on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTP_HOST} ^(www\.)?taastrategies\.com
RewriteRule ^(.*)$ https://www.taastrategies.com/$1 [R=301,L]
# add www prefix on requests that are sent over HTTPS protocol
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^taastrategies\.com
RewriteRule ^(.*)$ https://www.taastrategies.com/$1 [R=301,L]
# set HTTPS env var on forwarded requests (prevent redirection loop)
SetEnvIf X-Forwarded-Proto https HTTPS=on
# END HTTPS
I opened a ticket with SiteGround regarding landing page redirects for which I am being penalized by PageSpeed:
---------------- ticket to SiteGround support --------------------------------
I have one small problem remaining: user requrests for “taastrategies.com” are going through a series of landing page redirects:
http://taastrategies.com/
http://www.taastrategies.com/
https://www.taastrategies.com/
All other variations (www.taastrategies.com, https://taastrategies.com, https://www.taastrategies.com) are working without landing page redirects. Can we fix this? Given my rudimentary understanding of RewriteCond syntax, I am not inclined to tackle this without expert assistance.
-------------response from SiteGround support --------------------------------
The thing is that these redirects are added by the Cloudflare itself, i.e. our server forces the connection to www version of the website in order for all of the resources to be served via Cloudflare.
So the only way to fix this, sadly, would be to disable Cloudflare.
------------------- end of response ------------------------------------------------
CF Always Use HTTPS is enabled
So I contacted (free) CF support which pretty much blew off my problem with canned info about 400 and 500 series errors. It appears (from my reading here) that it is not possible to eliminate both redirects without shifting the CF off SiteGround, It does seem to me that it should be possible to eliminate one of the two redirects?
Thank you.