> Pages will also redirect HTML pages to their extension-less counterparts: for instance, /contact.html will be redirected to /contact, and /about/index.html will be redirected to /about/.
https://developers.cloudflare.com/pages/configuration/servin...
Keep in mind that this is Cloudflare Pages, not Cloudflare in general. Cloudflare Pages is a product where you give it a bunch of files, and it serves them as a web site. You don't have your own server behind Cloudflare in this case.
Serving a web site based on a directory of files is tricky, because URL space and filesystem space are a little bit different. Files on disk need to have file extensions to indicate their type, but URLs are not supposed to have file extensions, because their type is indicated by the `Content-Type` header. So if you are taking a bunch of files and serving them as a site, you need to figure out how to transform the type info in the URLs into Content-Type headers in an appropriate way. This is a solution to that.
Another remapping that nearly every file-based web server does is, if the URL turns out to be a directory, it returns a redirect to add `/` to the end, and then from there it serves the file called `index.html` in that directory. Again, this is needed because URL space and filesystem space don't exactly match: a directory on the filesystem cannot itself have byte content, it can only contain files. But a URL that is a directory can also directly serve content, so you have to figure out how to resolve that.
`index.html` remapping is pretty much universally accepted. But it's true that people have differing opinions on extension-stripping. The extension is redundant, but some people would rather keep it just to make it clearer how URLs map to files. Fair enough.
Unfortunately Cloudflare Pages does not have a setting for this right now. It has chosen to implement only the most popular approach. This is a product decision, and of course some people will disagree with it. You can submit a feature request, or you can use a different product that works the way you want (there are tons of them out there). But it's not a "bug" that the product has not chosen to implement your specific preferences.
(Disclosure: I work for Cloudflare, but not specifically on Pages.)
There are probably settings for this stuff.
It's quite normal for static sites to do something weird here. Like having folders that all contain index.html, and then having settings to strip (or add) the final slash.
There are so many different flavors, the only somewhat neutral default is what apache does.. still it's not much :)