Can you change the public URL of a file on Google Cloud Storage?

1.9k Views Asked by At

I'm storing a series of html files in a GCP bucket, and want to share a minified link for social media purposes. Trouble is, the minified link contains the full-length Public URL for redirection purposes, so at the moment the storage.googleapis.com url shows up on those social media cards.

Ideally I'd like it to show the minified url, but at the very least I'd like to change the Public URL in GCP to something more human-accessible.

2

There are 2 best solutions below

0
On

So when you're setting up you your domain you can use a CNAME record to point to redirect to google bucket

this answers it pretty clearly - https://stackoverflow.com/a/18650641/6147146

1
On

You have 2 ways to serve a website from Cloud Storage and to customize the URL.

  • First, if you want to serve your traffic ONLY in HTTP, you can follow this part of the documentation. It
  • Second, if you want to serve in HTTPS (and optionally also in HTTP) you need a LoadBalancer. The documentation explains the set up.