# Configure HUGO server for .htm files

**URL:** <https://discourse.gohugo.io/t/configure-hugo-server-for-htm-files/35621>\
**Category:** support\
**Created:** [November 17, 2021, 8:46am UTC](https://discourse.gohugo.io/t/configure-hugo-server-for-htm-files/35621 "2021-11-17T08:46:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![row-she](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/row-she/32/15627_2.png) [@row-she](https://discourse.gohugo.io/u/row-she)\
**Post date:** [November 17, 2021, 8:46am UTC](https://discourse.gohugo.io/t/configure-hugo-server-for-htm-files/35621/1 "2021-11-17T08:46:52Z")

</div>

Hi. For my project I have to render specific pages in different output formats (.html, .htm).  
I managed to do that like so:

In `config.toml` :

```auto
[mediaTypes]
  [mediaTypes.'text/htm']
    suffixes = ['htm']

[outputFormats]
  [outputFormats.htm]
    isHTML = true
    mediaType = 'text/htm'

```

I use `baseof.htm`, `single.htm` and `index.htm` layouts for that and  
specify in front matter how each individual site should be built like so:

```auto
outputs:
- htm

```

With the `hugo` command the `/public/` folder gets built just the way I want  
**but** `hugo server` seems not to be able to interpret the `text/htm` MIME type.  
(Firefox is asking me what application I want to use to open .htm files while Chrome  
is just displaying the raw code).

So I tried to configure the hugo server in `config.toml`:

```auto
[server]
  [[server.headers]]
    for = '/**'
    [server.headers.values]
      Accept = 'text/html, text/htm'

```

I also created `/config/development/server.toml` (as suggested in the docs):

```auto
[[headers]]
for = '/**'
[headers.values]
  Accept = 'text/html, text/htm'

```

Finally I created a `.htaccess` file in the `/static/` folder with:  
`AddType text/htm .htm`

Also tried:  
`AddType text/html .htm`

But nothing worked.

When I open the `.htm` files which are generated by `hugo` in the `/public/` folder, either locally  
or on a web-server, it works though.

So… maybe I am going about this the wrong way?

Any suggestions?

**hugo version** : `hugo v0.89.2+extended darwin/amd64`

Thanks in advance,  
Andy

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [November 17, 2021, 9:12am UTC](https://discourse.gohugo.io/t/configure-hugo-server-for-htm-files/35621/2 "2021-11-17T09:12:43Z")

</div>

```auto
mediaType = 'text/htm'

```

There is no media type text/htm. It’s always text/html to display HTML files. You want to display a file with the ending .htm and let the browser display parsed HTML. so the media type is always text/html.

---

<div class="post-metadata">

**Author:** ![row-she](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/row-she/32/15627_2.png) [@row-she](https://discourse.gohugo.io/u/row-she)\
**Post date:** [November 17, 2021, 9:48am UTC](https://discourse.gohugo.io/t/configure-hugo-server-for-htm-files/35621/3 "2021-11-17T09:48:03Z")

</div>

Thanks @davidsneighbour.

I already tried that. But that causes `hugo` to generate `.html` files in the `/public/` folder instead of `.htm`

Also I thought I would be adding that mediaType by:

```auto
[mediaTypes]
  [mediaTypes.'text/htm']
    suffixes = ['htm']

```
