We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25046
    • 194 Posts
    I am using the latest Modx Revo ( 2.5.5-pl) and am having trouble with my attempt to redirect users (that log in) to specific pages based on a "LoginResource" setting that I have associated with each user. I have been using Bob's Guides in an attempt to do this (which are excellent): http://www.bobsguides.com/blog.html/2015/09/23/redirecting-users-on-login-iii/ and I have followed the directions step by step.

    The problem is that after a user logs in, the result is a 404 error.

    For reference, this is the code that I am using for the plugin (as per Bob's recommendation):

    /* LoginRedirect plugin */

    /* Get the user setting */
    $docId = $modx->getOption('LoginResource', null);
    if (empty($docId)) {
    return '';
    }
    /* Create the URL */
    $url = $modx->makeUrl($docId, "", "", "full");

    /* Forward the User */
    $modx->sendRedirect($url);


    I have enabled the plugin with the OnWebLogin event so it should trigger after somebody logs in.

    For the user, I have set the LoginResource value to 484 so I expect that once a user logs in they will be directed to that page. However, it just results in a 404 error. Not sure why?

    Any suggestions would be greatly appreciated.

    Thanks,

    Rick