defaultExtension and specifying a Content-Type in http headers for the hugo server

Hi - I’ve just started playing with Hugo this evening, so please excuse me if this is an obvious one.

I’d like to use hugo to replace an existing site that is mostly static and currently running on I’d like to keep the URLs the same, so I’ll need them to end in the file extension “.aspx”, so I changed the defaultExtension property to “aspx”. The files are generated correctly on the file system (e.g. foo.aspx), however when I run the hugo server I can’t browse to them. The hugo server returns the http Content-Type header as “application/xml” which prevents them rendering correctly in most browsers. I need to configure it somehow to serve up the http Content-Type of “text/html” or similar. What is the best way to achieve this?


  1. The defaultExtension is an open bug. Contributions welcome.
  2. Hugo’s server is a development server. We could (and maybe should) do something about the content-type issue but it isn’t a priority (not for me anyway)

Hi. A Hugo newbie here. Like Joseph, I’d like to use the defaultExtension option (for htm rather than html). Am I right in thinking this is still an open bug?

No, it is fixed, see custom output types and custom media types.