如何在不指向带有html扩展名的文件的情况下访问Google存储桶上的html文件 [英] How to access html file on google storage bucket without pointing to file with html extension
本文介绍了如何在不指向带有html扩展名的文件的情况下访问Google存储桶上的html文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想让网站用户在请求www.website.com/userProfile(不带.html)时加载userProfile.html. 在文档中什么都没有.
I'd like to let website users load userProfile.html when they request www.website.com/userProfile (without .html). There is nothing about that in docs.
推荐答案
您可以提供不带.html后缀的HTML内容.设置内容类型很重要.例如,使用gsutil:
You can serve HTML content without a .html suffix. It's important to set the content-type though. For example, with gsutil:
gsutil -h "Content-Type:text/html" cp /path/users/userProfile \
gs://www.website.com/userProfile
这篇关于如何在不指向带有html扩展名的文件的情况下访问Google存储桶上的html文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文