I want to test a website locally before uploading the html files to a server, where they will sit behind Apache with the following in a VirtualHost configuration:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC]
The files to be served all have .html extensions, eg.,
rendered/
one.html
index.html
two.html
Suppose I use
my $app = route {
get -> *@path {
static 'rendered', @path,:indexes( 'index.html', );
}
}
Assuming CroApp is activated with port 5000,
and I try to view localhost:5000/one
I get, as I would expect, a 404.
So how do I mimic the Apache rewrite in a natural way?
My initial thought is: