Re: how to stop processing other rules if one is found

Splash Forums Rewrite Users how to stop processing other rules if one is found Re: how to stop processing other rules if one is found

#22286

The problem with priorities overriding other configurations is when you have an operation that needs to perform some type of action that does *not* abort the request, or mark it as handled – e.g: when you want to add a header, or a request parameter value. So we can’t do that, but I think that providing a lifecycle control is reasonable.

I think the best solution is to properly engineer your rules so that they do not conflict.

Regarding your 404 errors – Is it possible that you have nothing to handle that address?

Also, this rule looks cyclic to me. It will generate a URL that also matches the rule, leading probably to an infinite loop.

.defineRule()
.when(Direction.isInbound().and(DispatchType.isRequest())
.and(Path.matches("{path}").where("path").matches(".*")))
.perform(Redirect.permanent("/fi{path}"));

You might want to add a constraint to this pattern, so that you can ignore anything that already starts with “/li”.

.defineRule()
.when(Direction.isInbound().and(DispatchType.isRequest())
.and(Path.matches("{path}").where("path")
.matches(".*").constrainedBy(new Constraint() {...})))
.perform(Redirect.permanent("/fi{path}"));