“extensionless” urls with 11ty
Lots of web software is configured to create and serve
web files/pages with an .html extension/suffix.
That includes
11ty,
which by default creates an index.html for each
content template. It includes
Browsersync
— the hot-reload server invoked when you run
npx @11ty/eleventy --serve — which
determines the Content-Type response header based
on the output file's extension. And it includes
Apache HTTP server, which,
like Browsersync, uses the extension to map a file
to a Content-Type header.
And yet, even if your software defaults to .html, it
is not mandatory for the web.
There is no requirement that certain characters be
attached to your web page
urls.
In this article,
I'll explain how to make
clean urls
with Apache, Browsersync, and 11ty.