【问题标题】:Alternative to `x-amz-website-redirect-location` in Google Cloud Storage替代 Google Cloud Storage 中的“x-amz-website-redirect-location”
【发布时间】:2015-05-05 17:23:22
【问题描述】:

我想在 Google Cloud Storage 中托管一个网站,其中根指向某个文件夹(基本上它重定向到 /en/ 文件夹,默认语言)。

我可以在 Amazon S3 中使用 x-amz-website-redirect-location 标头完成此操作。但根据the documentation,该标头在 Google Cloud Storage 中不可用。

有没有一种干净的方法可以做到这一点?或者我应该在根目录中添加一个带有meta refresh 元素的 index.html 文件?

【问题讨论】:

  • 您必须使用元刷新。没有办法让 GCS 对象发回重定向。

标签: google-cloud-storage


【解决方案1】:

正如@jterrace 所评论的,目前无法使用标头进行重定向。解决方案是包含一个元刷新元素:

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

【讨论】:

    猜你喜欢
    • 2017-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-18
    • 1970-01-01
    • 2017-07-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多