Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirect www to non-www with cloud storage bucket static site

I have a static site hosted on google cloud storage bucket.

In front of my bucket I have cloudflare dns.

Storage bucket is example.com

Cloudflare settings: CNAME > @ > c.storage.googleapis.com > TTL automatic

Question is how to implement a redirect from www.example.com to example.com, because now www.example.com resolves to 404 error page?


1 Answers

Create a Page Rule on CloudFlare:

  • URL: www.example.com/*
  • Setting: Forwarding URL (301 or 302)
  • Destination: https://example.com/$1
like image 51
Daniel Loureiro Avatar answered Sep 07 '25 17:09

Daniel Loureiro