3

I am trying to build a website where I would like to leverage Google Cloud Storage to serve static assets. But want any resource which is not found in the bucket should fallback to my webserver. Is there a way to specify a fallback for the bucket.

Amol
  • 479
  • 5
  • 18

2 Answers2

0

Yes, this can be done by changing the 404.html on Cloud Storage to contain a redirect to another webpage.

You do this by adding in the header:

<meta http-equiv="Refresh" content="5; url=https://example.com"> 
Nahuel Varela
  • 1,022
  • 7
  • 17
-1

There are a few client side JavaScript/css ways to do this. For example https://medium.com/@webcore1/react-fallback-for-broken-images-strategy-a8dfa9c1be1e or Fallback background-image if default doesn't exist

bramp
  • 9,581
  • 5
  • 40
  • 46