Redirect w/o changing outbound URL

Splash Forums Rewrite Users Redirect w/o changing outbound URL

This topic contains 2 replies, has 3 voices, and was last updated by  Lincoln Baxter III 2 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #25991

    tragsdale
    Participant

    Can this be done? If so, how? From what I’ve read, there was a parameter in prettyfaces, but I don’t see one in rewrite. I tried using forward, but there seem to be complications with our Shiro configuration (the SecurityManager does not get passed). Redirect does not have this issue, but the URL gets changed … I even tried to Redirect on Inbound and Forward on Outbound, but that didn’t work. Heres my code:

    return ConfigurationBuilder.begin().addRule()
    .when(Direction.isInbound().and(Path.matches(“/{in-path}{in-rest}”)))
    .perform(Redirect.temporary(“/good{in-rest}”))
    .where(“in-path”).matches(“bad”).where(“in-rest”).matches(“.*”)
    // .addRule().when(Direction.isOutbound().and(Path.matches(“/{out-path}{out-rest}”)))
    // .perform(Forward.to(“/bad{out-rest}”)).where(“out-path”).matches(“good”)
    // .where(“out-rest”).matches(“.*”)
    ;

    #25994

    A forward is the way to go in this case. This will internally rewrite the URL and the URL in the address bar isn’t changed. If Shiro isn’t working correctly any more with this configuration, you will typically have to adjust your filter configuration. Please ensure that the Shiro filter is configured with the FORWARD dispatch type. See the second question here:

    http://ocpsoft.org/docs/prettyfaces/3.3.3/en-US/html/FAQ.html

    #26009

    Try something like this, as Christian says:

    return ConfigurationBuilder.begin().addRule()
    .when(Direction.isInbound().and(Path.matches(“/{in-path}{in-rest}”)))
    .perform(Forward.to(“/good{in-rest}”))
    .where(“in-path”).matches(“bad”).where(“in-rest”).matches(“.*”)
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Comments are closed.