0
votes

I'm curious about an aspect of Google Cloud static hosting (via a bucket) and wonder if anybody here has knowledge of it.

Before I moved my website over to GCP, I used an .htaccess file to rewrite files such as index.html to display when requested without .html

I found that this looked better and would display my site as www.domain.com/index rather than www.domain.com/index.html

I also used my .htaccess file to forced http requests to https

I know this is impossible with GCP, as htaccess files won't be read in a bucket. I read that app.yaml file will do this same thing, however, it's my understand that app.yaml is used by an App Engine. I host my website in bucket, and use a load balancer to allow https request.

If I create an app.yaml file and place it in my bucket, is it possible to get the same results I had with htaccess? Anybody have any suggestions?

Thanks.

1

1 Answers

0
votes

app.yaml is used to configure App Engine apps's settings [1]. For hosting a website in a bucket, it is not related. To achieve your goal, you can host your website in App Engine and configure the app.yaml.

As a workaround, you can have a javascript in your bucket to redirect to another URL [2].