找到你要的答案

Q:Alternative to `x-amz-website-redirect-location` in Google Cloud Storage

Q:替代` x-amz-website-redirect-location `谷歌云存储

I would like to host a website in Google Cloud Storage, where the root points to a certain folder (basically it redirects to the /en/ folder, the default language).

I can accomplish this in Amazon S3 using the x-amz-website-redirect-location header. But according to the documentation, that header is not available in Google Cloud Storage.

Is there a clean way to do this? Or should I add an index.html file in the root with a meta refresh element?

我想在谷歌的云存储网站,那里的根指向某个文件夹(基本上它重定向到/ EN /文件夹,默认的语言)。

我能做到这一x-amz-website-redirect-location头在使用Amazon S3。但根据文档,该头在谷歌云存储中不可用。

有干净的方法吗?或者我应该加入一个Meta刷新元根一个index.html文件吗?

answer1: 回答1:

As commented by @jterrace it is not possible to redirect using a header right now. The solution is to include a meta refresh element:

<html>
    <head>
        <meta http-equiv="refresh" content="0; url=/en/">
    </head>
</html>

评论@ jterrace不可能将现在使用的头文件。该解决方案是包括一个元刷新元素:

<html>
    <head>
        <meta http-equiv="refresh" content="0; url=/en/">
    </head>
</html>
google-cloud-storage