Reply To: stay at page rule

Splash Forums Rewrite Users stay at page rule Reply To: stay at page rule

#26652

Adrian
Participant

Does a variable exists where I can get the current page and another with the page where the user wants to navigate? (e.g commingFrom / goingTo)

The problem is that my rule should apply to about 20 pages and even if I create a rule for every page your solution will not work as long as I can decide if a real url page change is happening.

if the variable exist I could do a rule like

.addRule()
.when(Direction.isInbound().and(!commingFrom.equals(goingTo)))
    .and(new HttpCondition() {
  public boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context) {
    // your custom check here
  }
}))
.perform(Redirect.temporary(commingFrom));

So that the rule is active if a page change happens and the condition is true. Then he gets redirected to the commingFrom page. If condition is false he gets redirected to the goingTo page.