Reply To: Rewrite with subdomain is avaible?

Splash Forums PrettyFaces Users Rewrite with subdomain is avaible? Reply To: Rewrite with subdomain is avaible?

#26528

I think this rule is causing the failure:

.addRule()
.when(Domain.matches("dashboard.java.new.domain.net"))
.perform(Forward.to("/pages/dashboard/index.xhtml"));

If the request is sent to “dashboard.java.new.domain.net”, you are forwarding to a specific page. However, the forwarded request is ALSO addressed to “dashboard.java.new.domain.net” so it forwards again. And so on.

You should really also add an path condition to the rule. Something like:

.addRule()
.when(Direction.isInbound()
    .and(Domain.matches("dashboard.java.new.domain.net"))
    .and(Path.matches("/")))
.perform(Forward.to("/pages/dashboard/index.xhtml"));

However, in this case only the inbound part will work as expected.