无法弄清楚如何让网站指向非storage.googleapis地址

时间:2017-09-25 16:26:37

标签: google-cloud-platform google-cloud-storage

所以我差不多完成了我的网站。我已经创建了正确的存储桶(www.samuraifish.com),但由于某种原因,当我尝试获取公共链接时,它是https://storage.googleapis.com/www.samuraifish.com/htdocs/index.html而不是www.samuraifish.com。当我点击"编辑网站配置"我得到一条说明"你可以访问这个网站www.samuraifish.com",但是当我在浏览器中输入www.samuraifish.com时,我得到以下内容:

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
</Error>

我该如何解决这个问题?我已经通过Google Domains创建了我的CNAME,因此www.samuraifish.com应该指向c.googleapis.com。

谢谢, 普里亚

1 个答案:

答案 0 :(得分:0)

要仅在请求目录URL时显示特定页面(对于仅限域www.samuraifish.com URL的请求就是这种情况),您需要分配索引页。

来自Optional: Assigning index and error pages

  

索引页面(也称为webserver directory index)是   文件返回给请求a的静态站点的访问者   &#34;目录&#34 ;.如果是顶级网站,例如http://www.example.com,   请求,或请求丢失的页面,例如,   http://www.example.com/directory,服务尝试返回   索引页面。如果您还没有分配索引页面后缀,或者如果没有   &#34;目录&#34;没有关联的索引页面云存储   返回错误页面。控制哪个文件的属性   索引页面为MainPageSuffix

     

例如,如果MainPageSuffixindex.html,则为云存储   尝试在用户时返回对象www.example.com/index.html   请求http://www.example.com。同样,如果没有对象   www.example.com/directory,然后云存储尝试返回   用户请求时对象www.example.com/directory/index.html   http://www.example.com/directory。如果没有这样的对象,云   存储返回错误页面。

相关问题