Avoid landing page redirects


#1

Hello!

I’m having issues with redirects at GTmetrix results.

Avoid landing page redirects for the following chain of redirected URLs.

http://example.com/
http://www.example.com/
https://www.example.com/

How do I fix this, please?


#2

Make sure you have Cloudflare’s Crypto Tab set to Always Use HTTPS.

Aside from that, you’re always going to get a redirect if you type in the “wrong” URL (www when your site’s set for non-www, or vice-versa; http when your site is https). When a web server needs to autocorrect a URL, it’s going to use a redirect.

When I use GTmetrix, I type in the desired URL for my site, knowing the above will happen.


#3

Thank you for your reply!

My Cloudflare is already set to “Always Use HTTPS”.

I want my site with non www (https), but at my Dreamhost option says to set “Add WWW”. Any advice?

Just as an example:

http://example.com to https://example.com
http://www.example.com to https://example.com


#4

At Dreamhost, I always set my domains to remove the www. Personal preference.

With all that in place, it doesn’t surprise me that you’ll get a double redirect (http to https, then www to non-www). It happens to me too.

Sites like GTMetrix just see the 301 and dings you for it. So that’s why I type in the correct URL when testing performance at GTMetrix, Pingdom, Webpagetest, etc.


#5

Note in the attachment that I’m not able to make this change through Dreamhost.

Thanks!

57


#6

Unfortunately with Dreamhost you’re in a CNAME setup and they don’t have the ability to create CNAME for the root domain (technically it’s not allowed by RFC so that sort of makes sense). So that limits coverage to subdomains. I assume @sdayman doesn’t use the Dreamhost Cloudflare integration but signs them up directly.


#7

So there is no way around in this scenario?


#8

Well 2 options:

  1. You might be able to ask Dreamhost to redirect http://example.com directly to https://www.example.com using .htaccess which saves 1 redirect.

  2. You could sign the domain up with Cloudflare directly instead of through Dreamhost which puts it in a full setup (and requires changing the nameserver/ setting up your settings again) which would support using the bare root in addition to www.


#9

I’ll consider these.

Thank you again!


#10

Howdy folks,

Has this non WWW with Dreamhost been resolved?

We do not see anything new posted.

Can we move a domain back to Dreamhost and
not have WWW.

If we need to keep DH and CF separate to keep our domain
non WWW that will work.

Snippet from DH support:
“So he’d have to sign up through CloudFlare without the WWW and then hook 'em up?”

Not being in their partner program is not important for
us to use Dreamhost.


#11

I always set up my Cloudflare services independently of Dreamhost.

So, at Dreamhost, I always had my domains redirect to non-www. Then at Cloudflare, I had DNS “A” records for example.com and www that pointed to my Dreamhost IP address.

A visitor hitting www would pass through Cloudflare, then get redirected at Dreamhost to use non-www, so the visitor would again pass through Cloudflare, but without the www.

I’m definitely not a fan of the partnerships where much of your Cloudflare configuration is handled via the Partner’s panel. I think it’s a good option for those new to the system, but for more experienced users, I highly recommend the more manual independent setup.


#12

hey sdayman thanks for the quick reply.

Good to hear we can do just what you are saying
setup the “A” “AAAA” records in Cloudflare DNS.
Skip the Dreamhost panel.

Yes I read your post a few days ago and
told my crew we would be okay,
just do what “sdayman” said to do.

We used Dreamhost before, I liked them but
Google dropped our page rank.
We have non WWW preference in our Webmasters account.

I agree “handled via the Partner’s panel” I did not like that either.

We plan on adding more with Cloudflare and I would like to
keep in control.

Again thanks sdayman.