D6 - Rule to simply redirect path to login Currently I'm trying to add create a rule that simply redirects anyone from /node/add to /user/login. It's intended to be part of a larger rule, but I'm having No luck with this

Steps of the rule are


Trigger - User is going to view a page
If path has alias(es) - /node/add
Do page redirect to - /user/login


Instead, it just goes to the /node/add page as usual. Why is this simple rule is not working?

Here is the rule exported.

array (
  'rules' =&gt; 
  array (
    'rules_30' =&gt; 
    array (
      '#type' =&gt; 'rule',
      '#set' =&gt; 'event_init',
      '#label' =&gt; 'Redirect to login if accessing /node/add',
      '#active' =&gt; 1,
      '#weight' =&gt; '0',
      '#categories' =&gt; 
      array (
      ),
      '#status' =&gt; 'custom',
      '#conditions' =&gt; 
      array (
        1 =&gt; 
        array (
          '#weight' =&gt; -1,
          0 =&gt; 
          array (
            '#weight' =&gt; 0,
            '#info' =&gt; 
            array (
              'label' =&gt; 'Path has alias(es)',
              'module' =&gt; 'Path',
              'eval input' =&gt; 
              array (
                0 =&gt; 'src',
              ),
            ),
            '#name' =&gt; 'rules_condition_url_has_alias',
            '#settings' =&gt; 
            array (
              'src' =&gt; 'node/add',
            ),
            '#type' =&gt; 'condition',
          ),
          '#type' =&gt; 'OR',
        ),
      ),
      '#actions' =&gt; 
      array (
        1 =&gt; 
        array (
          '#weight' =&gt; 0,
          '#info' =&gt; 
          array (
            'label' =&gt; 'Page redirect /user/login',
            'label callback' =&gt; false,
            'module' =&gt; 'System',
            'eval input' =&gt; 
            array (
              0 =&gt; 'path',
              1 =&gt; 'query',
              2 =&gt; 'fragment',
            ),
          ),
          '#name' =&gt; 'rules_action_drupal_goto',
          '#settings' =&gt; 
          array (
            'path' =&gt; '/user/login',
            'query' =&gt; '',
            'fragment' =&gt; '',
            'force' =&gt; 0,
            'immediate' =&gt; 0,
          ),
          '#type' =&gt; 'action',
        ),
      ),
      '#version' =&gt; 6003,
    ),
  ),
)
One easy option is to set the 403 Access Denied page at:

admin/config/system/site-information

to:

user


That way, if the user is not authenticated, they can login and view the node/add page.

I think the reason your Rule isn't working is because /node/add isn't an "alias" per se, but a system path.

Another option is something like

/**
 * Implements hook_init
 */
function MODULENAME_init(){
  if($_GET['q'] == 'node/add' &amp;&amp; !user_is_logged_in()){
    drupal_goto('user/login');
  }
}