Forum Discussion

Henrik's avatar
Henrik
Advisor
11 years ago

Is it possible to make a redirect with REST or Freemarker?

Hi,   I’d like to make a redirect from server side, before the page loads. Is it possible to do that?   I have tested the http.response. setRedirectUrl("<redirect url>") object but it doesn’t wo...
  • DougS's avatar
    11 years ago

    Hi Henrik,

     

    The http.response.setRedirectUrl("<redirect url") call only works from a special freemarker Page Initialization script that runs once each request, early-on in the request (before any of the html is rendered) and is there to allow for things like redirects.  Traditionally, professional services has added this for customers, but we have exposed this through Lithium Studio as a beta feature.  If you contact support and reference this Lithosphere post, they should be able to enable the tab (called "Page Initalization") that lets you edit this template.

     

    -Doug