Reply To: 301 permanent Redirect

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

#27255

Sure, absolutely:


Map<String, String> urlMap = ...
for( String oldPath : oldPaths )
{
   builder.addRule
      .when(Path.matches(oldPath))
      .perform(Redirect.to(urlMap.get(oldPath)))
}

Or however you want to implement the loop. Remember you can use {params} to simplify many mappings if your URL structure has patterns and repetition.