4 Replies Latest reply on Oct 4, 2012 4:42 AM by shin4649

    Redirecting page

    shin4649 Level 1

      I am using the redirect option in page properties to redirect pages but the page just displays

      "This page redirects to <Page Name>" in publisher mode.


      Why is it not working?

        • 1. Re: Redirecting page
          kasq Level 3



          Probably when you wrote your custom code you didn't copy something from the main page component from libs.

          Try to check if in your custom component related to page template in which you wants to use Vanity URL attribute you haveat the begining



              // read the redirect target from the 'page properties' and perform the

              // redirect if WCM is disabled.

              String location = properties.get("redirectTarget", "");

              // resolve variables in path

              location = ELEvaluator.evaluate(location, slingRequest, pageContext);

              if (WCMMode.fromRequest(request) != WCMMode.EDIT && location.length() > 0) {

                  if (WCMMode.fromRequest(request) != WCMMode.PREVIEW) {



                  // check for recursion

                  if (!location.equals(currentPage.getPath())) {


                  } else {





              // set doctype




          This is a little customized version of checking redirect attribute and redirects should works for a page which it is open only in the preview mode in author.


          I hope that this helps you.




          • 2. Re: Redirecting page
            shin4649 Level 1



            Works well now except for the docstyle. I did include file "com.day.cq.wcm.api.designer.Design" but still getDoctype not define.

            • 3. Re: Redirecting page
              kasq Level 3



              Try to import com.day.cq.commons.Doctype in the jsp and also add <cq:defineObjects/>



              • 4. Re: Redirecting page
                shin4649 Level 1

                Everything was working fine but suddenly, I got this error:


                response already committed (500)


                not sure what is the problem now.





                Note: Problem solved. Redirect.jsp has to be executed first before anything else.


                Message was edited by: shin4649

                1 person found this helpful