You can add a shared route to the routes file (at the end of the file, because its priority will be estimated based on its location of the ad)
GET /:page controllers.Application.showPage(page)
Put your logic that you want to execute at runtime in the controller class
public static Result showPage(String page){ if(page.contains("abc"){ ..... } else {
I'm not sure if this will meet your requirements, but in most scenarios this will be enough.
source share