显示原始文本的aws s3中的index.html

时间:2017-01-15 14:41:29

标签: html amazon-web-services browser indexing render

笔记本电脑上的相同index.html正确显示网页。 aws按原样显示文本,如下所示,没有渲染。遵循S3静态网站托管步骤。 FYI。

<html>
<head>
<title>Testing, Inc.</title>
</head>
<body bgcolor="#EDDD9E">
<h1 align="center">Welcome!</h1>
<p>Welcome to my <strong>first</strong> webpage. I am writing this page using a text editor and plain old html.</p>
<p>By learning html, I'll be able to create web pages like a pro....<br>
which I am of course.</p>
Here's what I've learned:
<ul>
<li>How to use HTML tags</li>
<li>How to use HTML colors</li>
<li>How to create Lists</li>
</ul>
</body>
</html>

感谢您的帮助。

2 个答案:

答案 0 :(得分:3)

如果文件的扩展名不是html / htm或者文件没有​​扩展名,它会将Meta Data / Content-Type设置为application / octet-stream,你可以将它更新为text / html,它就可以了。

enter image description here

答案 1 :(得分:0)

对于未来,如果有人正在阅读本文,如果您的代码没有被呈现并且您正在使用 Windows。

在您保存文本文件的文件夹中,转到“查看”,然后在“选项”中单击“更改文件夹和搜索选项”。

然后单击“查看”选项卡并取消选中“隐藏已知文件类型的扩展名”。