Re: Clarification on withInboundCorrection method…

Splash Forums Rewrite Users Clarification on withInboundCorrection method… Re: Clarification on withInboundCorrection method…

#22512

Hmmm. IMO it is bad practice to support two externally facing URLs that have the same content. One of them should perform a permanent redirect to the other. You should handle this with a separate rule to canonicalize your URLs.

.defineRule().when(Direction.isInbound().and(Path.matches("/{}/ContactUs"))).perform(Redirect.permanent(context.getContextPath() + "/contact-us"));

You could also create an outbound rule that does this globally for your URLs if you understand how Tapestry is going to work.

.defineRule().when(Direction.isOutbound()).and(Path.captureIn("path")).perform(Canonicalize.path("path"));

Note that canonicalize does not currently exist; this is pseudocode.