Reply To: 301 permanent Redirect

Splash Forums Rewrite Users 301 permanent Redirect Reply To: 301 permanent Redirect

#27254

banifou
Participant

Great! It’s working.
On more question, I’ve a not so small list of url to redirect.
My code looks like following:

public class RewriteUrlConfig extends HttpConfigurationProvider {

    public Configuration getConfiguration(final ServletContext context) {
        return ConfigurationBuilder.begin()
      
       // many rules like this
      .addRule(Join.path("/home").to("/home.jsf"))
        .
        .

       // now added the redirect
       .addRule().when(Path.matches("/old/{path}"))
       .perform(Redirect.permanent("http://domain.com/new/{path}/etc/etc"));
}
}

Is there a way to loop over the list and add all the redirects?
Thanks