We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13730
    • 149 Posts
    HI,

    Modx : 2.2.1
    Redirector : 1.03

    When I use Redirector with published resources it is working correctly, but when I use it with a unpublished resources it going to the 404 page.

    I want to use it with resource that are temporarily unpublished.

    My question is, did Redirector work only with a published resource?

    Thank for your answers [ed. note: jber last edited this post 12 years, 11 months ago.]
      • 25803 ☆ A M B ☆
      • 721 Posts
      It's probably redirecting to your unpublished resource but you'll get a 404 because the page is unpublished, which has nothing to do with Redirector.

      A page has to be published for it's alias to resolve unless you're logged into the Manager. Any member of the viewing public will not be able to view unpublished pages because they are unpublished. When MODX parses a link such as http://www.yoursite.com/kittens.html and the kittens resource is unpublished it is telling the system not to show this page and therefore you'll get the 404 page.
        • 13730
        • 149 Posts
        Thank you for your answer.

        But I found that the «cacheable option» for a resource has to be off, that solve my problem.

        Thank again
          • 3749
          • 24,544 Posts
          MODX fires the OnPageNotFound event when a page is unpublished before redirecting to the error page, so you should be able to do the redirection in a plugin attached to that event.

          The URL of the requested page should be available there as $_SERVER['REQUEST_URI'];
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting