Re: Simple login rewrite

Splash Forums Rewrite Users Simple login rewrite Re: Simple login rewrite

#22923

Which version of rewrite are you using?

Instead of this:

config.defineRule()
.when(DispatchType.isRequest()
.and(Path.matches("/admin"))
.andNot(Path.matches("/admin/login.xhtml"))
.andNot(loggedIn))
.withPriority(Integer.MAX_VALUE)
.perform(Forward.to("/admin/login.xhtml"));

Why not use Join instead?

.addRule(Join.path("/login").to("/admin/login.xhtml").withInboundCorrection()).wnen(Not.any(loggedIn))

Also. Both of your rules forward to /admin/login.xhtml, so I’m not really sure what you are trying to achieve there.

Regarding the JSessionID, let’s work that out once we have figured out your problem with this 404 page.

~Lincoln