I want all .html files to be redirected to a public folder where they are located so I put this in my routes file:
GET /$file<.html> controllers.Assets.at(path="/public/html", file)
but it says Action not found For request 'GET /index.html'
but I can see it there (when the error appears):
GET/$file<.html> controllers.Assets.at(path:String = "/public/html", file:String)
Does anybody know what I am doing wrong?
The regex you specified
<.html>is only going to match a request that looks like “/ahtml”, “/bhtml”, “/chtml”, or so on since the “.” is a single character wildcard.What you want is something like this, I think:
The
.*is a catch-all for whatever the first part of the file happens to be.The
\.html$is what restricts it to html files. Though not strictly necessary, I escaped the dot so it actually matches a period instead of any character.