Redirect non-www URLs

Splash Forums Rewrite Users Redirect non-www URLs


This topic contains 2 replies, has 2 voices, and was last updated by  rocotocloc 8 months, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #27689



    I want to force my users to always use the ‘www’ URL style in my application but I cannot find the solution.

    If some particular user types I want to automatically redirect him to Of course this must be done for all kinds of sub-paths in the real page.

    Could you please help me?

    Thank you very much.

    • This topic was modified 8 months, 2 weeks ago by  rocotocloc.

    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. 😉



    I’ll give it a try.

    Thank you 😀

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Comments are closed.