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

#26700
.addRule()
.when(
   Domain.matches("{testerId}.domain.com").and(Direction.isOutbound())
)
.perform(new HttpOperation() {
   @Override
   public void performHttp(HttpServletRewrite event, EvaluationContext context)
   {
      // Something like this... it needs to be changed to fit your exact scenario
      String oldUrl = event.getAddress().toString();
      String newUrl = Parameters.retrieve(context, "testerId") + "." + oldUrl;
      
      Substitute.with(newUrl).perform(event, context);
      
   }
})
)

Etc.