Skip to content

Instantly share code, notes, and snippets.

@pledbrook
Created June 26, 2014 10:09
Show Gist options
  • Save pledbrook/9e1e6e0e1a520b6a3612 to your computer and use it in GitHub Desktop.
Save pledbrook/9e1e6e0e1a520b6a3612 to your computer and use it in GitHub Desktop.
Trying to redirect all paths below a given prefix (GET only)
ratpack {
...
handlers {
get {
...
}
prefix("blog") {
handler {
redirect 303, "http://blog.cacoethes.co.uk/${get(PathBinding).pastBinding}"
}
}
assets "public"
}
}
@robfletcher
Copy link

@pledbrook I see, didn't realize what you were doing with the remainder of the path there

@pledbrook
Copy link
Author

@danveloper The first time I tried that the app was hanging, which is why I resorted to Help By Twitter. Still, it seems unnecessarily verbose and confusing. Not sure why byMethod() isn't a handler itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment