如何使 Google Cloud Storage Bucket 作为静态网站在有和没有 www 的情况下可见?

How make the Google Cloud Storage Bucket as a static-website Visible With and Without www?

大家好,我在"Documentation of Google Cloud Storage - Configuring a Bucket as a Static Website"我的存储桶中遵循了所有正确的配置,它作为一个网站工作,但实际上当我访问存储桶时,问题是关于前缀 WWW http://www.pieropretti.net I can see the content of the public bucket, but if I visit (from the browser Chromium version 42.0.2281.0 (64-bit) and same problem from the browser FirefoxESR 31.4.0 (Tor Browser 4.0.3) without the prefix WWW I receive the error server not found. This is the screenshot of the domain name DNS configuration in the picture here http://tinyurl.com/ncoc9y5

"www.pieropretti.net"和"pieropretti.net"是不同的域名,所以也对应不同的bucket。如果您想提供来自 "pieropretti.net" 的内容,您需要创建一个完全命名为 "pieropretti.net" 的存储桶,其创建方式与创建 "www.pieropretti.net" 存储桶的方式相同。

据我所知,"pieropretti.net." 的 DNS 设置似乎没有 CNAME,尽管您的面板告诉您。也许它还没有传播给我。

从 DNS 记录我注意到您在 OVH 上,如果是,您可以使用 OVH Redirection Technology 从 naked 重定向到 WWW。

如果您是其他维护者,请不要担心,所有维护者都提供像 OVH 这样的服务来将裸体重定向到 www。

顶级域名不能加CNAME,可以加A记录,所以我去终端ping c.storage.googleapi.com获取IP地址,然后用IP地址添加进入 A 记录,它对我有用,只是不确定这样做是否合适,但它对我有用。