Skip to content

Instantly share code, notes, and snippets.

@yatskevich
Created September 5, 2013 15:42
Show Gist options
  • Save yatskevich/6451927 to your computer and use it in GitHub Desktop.
Save yatskevich/6451927 to your computer and use it in GitHub Desktop.
Normalize GET URLs in Play Framework 2.x
package controllers
import play.api.mvc._
import play.api.mvc.Results._
object Application extends Controller {
def untrail(path: String) = Action {
MovedPermanently("/" + path)
}
}
GET / controllers.Application.index
GET /*path/ controllers.Application.untrail(path: String)
# other routes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment