Created
September 5, 2013 15:42
-
-
Save yatskevich/6451927 to your computer and use it in GitHub Desktop.
Normalize GET URLs in Play Framework 2.x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package controllers | |
import play.api.mvc._ | |
import play.api.mvc.Results._ | |
object Application extends Controller { | |
def untrail(path: String) = Action { | |
MovedPermanently("/" + path) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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