How to rediect domain.com to www.domain.com?

Splash Forums Rewrite Users How to rediect domain.com to www.domain.com?

This topic contains 1 reply, has 2 voices, and was last updated by  Lincoln Baxter III 2 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25890

    ravindra
    Participant

    Hi,

    I am deploying my JSF (Rewrite integrated) application in Tomcat 7 at Linux server. I haven a requirement. When the user types domain.com in the browser it should be redirected to http://www.domain.com. Can you guide me to achieve this using Rewrite.

    Thanks,

    #25907

    Try:

    .addRule()
    .when(Domain.matches("www.domain.com").and(Path.captureIn("path")))
    .perform(Redirect.to("http://domain.com/{path}"))
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Comments are closed.