Re: redirect from root app to app with other context in same host in tomcat

Splash Forums Rewrite Users redirect from root app to app with other context in same host in tomcat Re: redirect from root app to app with other context in same host in tomcat

#22216

Serkan Durusoy
Participant

Quick update,

I chose to go with rewrite since it seems to suit the job better.

Now the question is; what should my configuration look like?

I tried this as a quick solution:

public class MyappConfigurationProvider extends HttpConfigurationProvider {

@Override
public int priority() {
return 10;
}

@Override
public Configuration getConfiguration(final ServletContext context) {
return ConfigurationBuilder.begin()
.defineRule()
.when(Direction.isInbound().and(Path.matches("/{page}")))
.perform(Redirect.temporary("/myapp/{page}"));
}
}

This seems to work with http://mydomain/xxxx but not with http://mydomain