I am trying to configure a very simple static server scenario to remove the .HTML extension from appearing in the browser address bar. E.g. my source files that are being served all end in .HTML but I want a clean url presented to the end user
Thanks, @francislavoie. I agree re Caddyfile. I just started experimenting with it and it is infinitely easier than JSON. When I convert a simple Caddyfile to JSON I am surprised by the verbosity.
I tried your example, but if I click a link in my site that ends in .HTML then I still get that in the address bar. At some point, I will look into extending my build script to rewrite all embedded links. For now, I have this workaround that strips any .HTML extensions and then redirects to that URL. Since the URL does not exist internally, Caddyfile then tries the URL with the .HTML extension.
Following a URL with a .HTML extension does result in a 301 redirect, but following an extensionless one does not.
I can live with that additional redirect overhead for now until I can rewrite all internal anchors to remove the extension.
Other that the additional redirect, do you see any issue with this approach?