Reply To: Rewrite with subdomain is avaible?

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

#26527

Kris Groove
Participant

Config:

@RewriteConfiguration
public class ConfigurationProvider extends HttpConfigurationProvider {

	   @Override
	   public Configuration getConfiguration(final ServletContext context) {
	      ConfigurationBuilder configurationBuilder =  ConfigurationBuilder.begin();

	          // Using parameters to return physical resources
	          //.addRule(Join.path("/{param}").to("/pages/{param}"))
	          // Redirect requests to the server-side resource to the correct location
	      
	      configurationBuilder.addRule()
	      	.when(Domain.matches("dashboard.java.new.domain.net"))
	      	.perform(Forward.to("/pages/dashboard/index.xhtml"));
	      
	      configurationBuilder
	      	.addRule(Join.path("/dashboard/")
	      	.to("/pages/dashboard/index.xhtml").withInboundCorrection());
	      
	      configurationBuilder
	      	.addRule(Join.path("/signup/")
	      	.to("/pages/signup.xhtml").withInboundCorrection());
	      
	      configurationBuilder.addRule()
	      	.when(Direction.isInbound().and(Path.matches("/{page}")))
	      	.perform(Redirect.permanent("/{page}/"));

	      return configurationBuilder;
	   }

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