http.ext
ext allows your site to have clean URLs by assuming a file extension when the path of the URL does not end with one.
An extension in the URL is detected by checking the last element of the path for a dot (.
).
Syntax
ext *extensions...*
- extensions… is a list of space-separated extensions (including the dot) to try. Extensions will be tried in the order listed. At least one extension is required.
Examples
Suppose you have a file called /contact.html. You could serve that file at /contact by having Caddy try .html files.
To try .html, .htm, and .php in order:
ext .html .htm .php
Need help with this feature?
Join us in the Caddy forum, where the open source community gathers to share their knowledge.
Does your company use Caddy?
Purchase a commercial license to use Caddy with your business and for basic email support, along with other benefits!