Path Redirect Module Quick and Simple Alternative

If you have at least one module in your site and you need to redirect a page, here's a simple and quick way to do it without installing the path_redirect module.

This code goes inside your hook_menu().

Important to note, you have to put your redirect code in single-quotes or this will not work, as the menu module will think you are referencing an arg() placeholder.

Of course you need to replace [new url] and [old url] with the appropriate paths.

//redirect using default 302 HTTP header code
$items['[old url]'] = array(
  'page callback' => 'drupal_goto',
  'page arguments' => array('[new url]'),    
  'access callback' => TRUE,
  'type' => MENU_CALLBACK,  
);

//redirect with other HTTP header code
$items['[old url]'] = array(
  'page callback' => 'drupal_goto',
  'page arguments' => array('[new url]', NULL, NULL, '301'),    
  'access callback' => TRUE,
  'type' => MENU_CALLBACK,  
);