Open finanalyst opened 1 year ago
Further to the above, Possibly make this more generic using :try-files
.
Apache uses a ReWrite conditional/rule. The conditional checks that the route is not a directory or existing file, then carries out a Regex based rewrite.
NGINX and Caddy use try-files
. If a route does not match an existing file, then alternatives are tried.
A common rewrite is to add
.html
to routes on a website. Eg.routines/say
is mapped to the web pageroutines/say.html
andtypes/IO#say
is mapped totypes/IO.html#say
Currently
:indexes
adds a named file when there is a zero route.Possibly
:extension<html>
might add.html
if the route does map to an existing file.