# Static website: index.html does not open in browser, instead it downloads

**URL:** <https://forum.storj.io/t/static-website-index-html-does-not-open-in-browser-instead-it-downloads/19728>\
**Category:** troubleshooting\
**Created:** [September 18, 2022, 3:23pm UTC](https://forum.storj.io/t/static-website-index-html-does-not-open-in-browser-instead-it-downloads/19728 "2022-09-18T15:23:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian1](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/brian1/32/7827_2.png) [@Brian1](https://forum.storj.io/u/Brian1)\
**Post date:** [September 18, 2022, 3:23pm UTC](https://forum.storj.io/t/static-website-index-html-does-not-open-in-browser-instead-it-downloads/19728/1 "2022-09-18T15:23:54Z")

</div>

Trying to use storj to host static website.

1. I used uplink to create a share:  
uplink share --dns www.my\_web\_address.com sj://my\_bucket\_name/ --base-url [https://link.storjshare.io](https://link.storjshare.io)

2. I updated my dns settings:  
|my\_web\_address.com |IN|CNAME|link.storjshare.io.|  
|—|—|—|—|  
|txt-www.my\_web\_address.com|IN|TXT |storj-root:my\_bucket\_name|  
|txt-www.my\_web\_address.com|IN|TXT |storj-access:jw4zfxb5q2zs4e3uinc6sestwxaq|

Problem: When I navigate to www.my\_web\_address.com, the index.html file is not displayed - it only downloads the file.

Any thoughts anyone?

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [September 18, 2022, 4:28pm UTC](https://forum.storj.io/t/static-website-index-html-does-not-open-in-browser-instead-it-downloads/19728/2 "2022-09-18T16:28:03Z")

</div>

Hello @Brian1,  
Welcome to the forum!

If you rename it to `index.htm` does it change anything?

---

<div class="post-metadata">

**Author:** ![Brian1](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/brian1/32/7827_2.png) [@Brian1](https://forum.storj.io/u/Brian1)\
**Post date:** [September 18, 2022, 7:06pm UTC](https://forum.storj.io/t/static-website-index-html-does-not-open-in-browser-instead-it-downloads/19728/3 "2022-09-18T19:06:06Z")

</div>

I’ve changed it to index.htm and I now get this message:  
Oops! Object not found.  
…and it no longer downloads

---

<div class="post-metadata">

**Author:** ![sean](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/sean/32/8744_2.png) [@sean](https://forum.storj.io/u/sean)\
**Post date:** [September 18, 2022, 9:29pm UTC](https://forum.storj.io/t/static-website-index-html-does-not-open-in-browser-instead-it-downloads/19728/4 "2022-09-18T21:29:14Z")

</div>

Was the file uploaded using uplink or S3 gateway?

If you try `curl [youraddress]/index.html -vvv` what response headers are showing for you? I am interested if `Content-Type` was set incorrectly, which is one reason the browser will not recognise it as HTML and download the file instead.

---

<div class="post-metadata">

**Author:** ![Erikvv](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/erikvv/32/71_2.png) [@Erikvv](https://forum.storj.io/u/Erikvv)\
**Post date:** [September 19, 2022, 8:42am UTC](https://forum.storj.io/t/static-website-index-html-does-not-open-in-browser-instead-it-downloads/19728/5 "2022-09-19T08:42:05Z")

</div>

This is probably not the cause but your CNAME record should include “www” also:

```auto
www.my_web_address.com. 3600 IN CNAME link.storjshare.io.

```

---

<div class="post-metadata">

**Author:** ![mgonzalezm](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mgonzalezm/32/1125_2.png) [@mgonzalezm](https://forum.storj.io/u/mgonzalezm)\
**Post date:** [September 21, 2022, 7:55pm UTC](https://forum.storj.io/t/static-website-index-html-does-not-open-in-browser-instead-it-downloads/19728/6 "2022-09-21T19:55:32Z")

</div>

I am having this problem too.  
The file was uploaded using uplink  
The content type returned is “application/octet-stream”

```auto
* Trying redacted-IPV6-address ..
* Connected to redacted port 80 (#0)
> GET /index.html HTTP/1.1
> Host: redacted
> User-Agent: curl/7.85.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Access-Control-Allow-Headers: *
< Access-Control-Allow-Methods: GET, HEAD
< Access-Control-Allow-Origin: *
< Cache-Control:
< Content-Length: 142
< Content-Type: application/octet-stream
< Date: Wed, 21 Sep 2022 19:27:49 GMT
< Last-Modified: Thu, 24 Feb 2022 00:33:43 GMT
<
<!doctype html>
<html>
  <head>
    <title>Welcome!</title>
  </head>
  <body>
    <p>Hello <strong>world !!!</strong>.</p>
  </body>
</html>

```

---

<div class="post-metadata">

**Author:** ![sean](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/sean/32/8744_2.png) [@sean](https://forum.storj.io/u/sean)\
**Post date:** [September 21, 2022, 8:14pm UTC](https://forum.storj.io/t/static-website-index-html-does-not-open-in-browser-instead-it-downloads/19728/7 "2022-09-21T20:14:57Z")

</div>

Could you show the output of `uplink meta get sj://path/to/file/index.html`?

It seems like linksharing might not be detecting the right content type. It tries to auto-detect based on the extension. If `Content-Type` is set in metadata (or `content-type` in lowercase put by S3 clients), it will use that instead of guessing.

We have a fix on the way around these content types to auto-detect, but one way to ensure the file gets the right type is to set `--metadata '{"Content-Type":"text/html"}` when uploading the file with uplink.

If using S3, you can set content type on an existing file by `aws s3 cp` with the same source and destination, e.g. `aws s3 cp s3://path/to/file s3://path/to/file --content-type text/html`. The same flag can be used when uploading a new file as well.

---

<div class="post-metadata">

**Author:** ![mgonzalezm](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/mgonzalezm/32/1125_2.png) [@mgonzalezm](https://forum.storj.io/u/mgonzalezm)\
**Post date:** [September 21, 2022, 9:40pm UTC](https://forum.storj.io/t/static-website-index-html-does-not-open-in-browser-instead-it-downloads/19728/8 "2022-09-21T21:40:24Z")

</div>

Well, maybe i was wrong and didn’t originally upload the file with uplink (it was some time ago), but back then it was working fine.

The metadata it had was:

```auto
{
  "content-type": "application/octet-stream",
  "s3:etag": "9c9fdecbe6f81ac1c805f09edffe712f"
}

```

Now I reuploaded the file with uplink, and it works correctly ( with an empty set as metadata )

Thank you.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [September 22, 2022, 8:43am UTC](https://forum.storj.io/t/static-website-index-html-does-not-open-in-browser-instead-it-downloads/19728/9 "2022-09-22T08:43:16Z")

</div>

Then I can guess that you have used the [Objects browser](https://docs.storj.io/dcs/getting-started/quickstart-objectbrowser/) in the satellite UI.
