Reply To: 301 permanent Redirect

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

#27285

Without too much commentary from me on why your code didn’t work, I’ll just say that can’t run code after you return from a function. Just assign the builder you are already using to a variable named “builder”. This should fix your code:

public Configuration getConfiguration(final ServletContext context) {
       ConfigurationBuilder builder = ConfigurationBuilder.begin()     
                
        for (Map.Entry pair : linkName.entrySet()) {
            builder.addRule().when(Direction.isInbound().and(Path.matches("/some/{page}/"))).perform(Forward.to("/new-{page}/"));
        }

        return builder;
    }