Reply To: Create subdomain in Rewrite? Like http://tester12345.domain.com

Splash Forums Rewrite Users Create subdomain in Rewrite? Like http://tester12345.domain.com Reply To: Create subdomain in Rewrite? Like http://tester12345.domain.com

#26670

Basically you will have to create an outbound rule which creates absolute URLs from the relative paths that are usually created by the container. So basically something like this:

.addRule()
.when(Direction.isOutbound())
.perform(new HttpOperation() {
   @Override
   public void performHttp(HttpServletRewrite event, EvaluationContext context)
   {
      
      String oldUrl = event.getAddress().toString();
      String newUrl = ...;
      
      Substitute.with(newUrl).perform(event, context);
      
   }
})