Reply To: Redirect xhtml to html

Splash Forums Rewrite Users Redirect xhtml to html Reply To: Redirect xhtml to html

#25352

You want to redirect, not forward? Also, what exactly is not working? Your configuration doesn’t look correct, because {params} don’t match over / by default, additionally…

If you look at the docs on Redirect, it documents that you must also prepend the Servlet context path:

   /**
    * Create an {@link Operation} that issues a permanent {@link Redirect} ( 301
    * {@link HttpServletResponse#SC_MOVED_PERMANENTLY} ) to the given location. If the given location is not the same as
    * {@link HttpServletRewrite#getAddress()}, this will change the browser {@link URL} and result in a new request.
    * 
    * <p>
    * Note that in order to redirect to a resource within the {@link ServletContext}, you must prepend the
    * {@link ServletContext#getContextPath()}.
    * 
    * <p>
    * For example:<br/>
    * <code>
    *    Redirect.permanent(contextPath + &quot;/example/location.html&quot;) <br>
    * </code>
    * 
    * <p>
    * The given location may be parameterized:
    * <p>
    * <code>
    *    /store/global
    *    /store/{category} <br>
    *    /store/{category}/item/{itemId} <br>
    *    ...
    * </code>
    * <p>
    * 
    * @param location {@link ParameterizedPattern} specifying the target location.
    * 
    * @see ConfigurationRuleParameterBuilder#where(String)
    */
   public static Redirect permanent(final String location)

ServletContext.getContextPath() will be available from the context method parameter in your configuration provider.