Reply To: How do I forward to another host?

Splash Forums Rewrite Users How do I forward to another host? Reply To: How do I forward to another host?

#24024

Forwards are always processed within the same servlet engine. So you can only forward to another resource on the same server.

You will have to perform a redirect instead:


.addRule()
.when(Direction.isInbound().and(Path.matches("{path}/external")))
.perform(Log.message(Level.INFO, "external path: {path}")
    .and(Redirect.temporary("http://externalserver/page"))
.where("path").matches(".*")

This will send a redirect response code to the client and the client will then send a separate request to the new URL.

Does this fit your needs?