Reply To: Redirect non-www URLs

Splash Forums Rewrite Users Redirect non-www URLs Reply To: Redirect non-www URLs


You could try something similar to this:

.perform(new HttpOperation() {
   public void performHttp(HttpServletRewrite event, EvaluationContext context) {

      String newUrl = event.getInboundAddress().toString()
               .replace("", "");

      Redirect.temporary(newUrl).performHttp(event, context);


I didn’t test it, but it shows the idea. You can use the Domain condition, but the operation requires some custom code. Which certainly can be improved. 😉