This will redirect every request not ending in ".html" to the .html version.
@endpoint void redirect(Request r, Output o) { if (!r.path.endsWith("/") && !r.path.endsWith(".html")) { o.addHeader("location", r.path ~ ".html"); o.status = 302; // 301 if redirect is permanent, of course. } }
There was an error while loading. Please reload this page.