Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cloud Load Balancer: Duplicate URLs when serving a static Website

Hello,

I have configured a static website with a Cloud Bucket and and Cloud Load Balancer that serves a bucket backend. It works well.

The problem I have though, is that the design currently uses multiple URLs for the same resource, see:
https://cloud.google.com/storage/docs/static-website#examples

So, basically, with an index page index.html, the routing is like this:

URLRedirectionResource served
/contact/None/contact/index.html
/contact/index.htmlNone/contact/index.html
/contact/contact/index.htmlNone

There are several things I do not like here:

  • There are two URLs for the same resource: /contact/ and /contact/index.html
  • The URL /contact is redirected to /contact/index.html

What I would like is to have only one URL to access the resource, and an option to choose if it is the route with the trailing slash or not.

So,  with the trailing slash option off, the routing would look like this:

URLRedirectionResource served
/contactNone/contact/index.html
/contact//contactNone
/contact/index.html/contactNone

Any chance you could add this option?

EDIT: Fixed resource served for clarity

2 2 331
2 REPLIES 2

Hello, were you able to fix this?

What I have done is to add a trailing "/" to all my internal URLs to avoid any redirection to the */index.html page. It's not perfect but it's OKish.