Is this correct usage of hook_node_view()? hook_node_view_alter(&amp;$vars, $hook) {

  global $base_url;

  if($vars['#node']-&gt;status == 0) {
    header('Location: '.$base_url.'/?errCode');
  }
}


Simple hook to redirect unpublished nodes to prevent 404s (this is just a proof of concept). 

Factor 1: There is already existing unpublished pages that have redirects (via the Redirect Module from Drupal Core) - this shouldn't affect that.

This is placed in my theme/template.php file but I'm not confident that this hook is best suited (although it works). Is there a lower level menu router hook which I can use?
Is there a lower level menu router hook which I can use?


Yes, there is - you would need to use hook_menu_alter() to achieve this. Here's the code you should use:

function YOUR_MODULE_menu_alter(&amp;$items) {
  $items['node/%node']['page callback'] = 'YOUR_MODULE_node_page_handler';
}

function YOUR_MODULE_node_page_handler($node) {
  // If the node is unpublished, redirect the user.
  //
  // Note: I would recommend adding an extra check so administrators and
  // users who can manage the nodes are not redirected. This way, they can
  // work with unpublished nodes.
  //
  // This is what you would use instead in that case:
  // if ($node-&gt;status == NODE_NOT_PUBLISHED &amp;&amp; !user_access('administer nodes')) {
  //
  // This will work for ALL users on the site, including the administrators.
  if ($node-&gt;status == NODE_NOT_PUBLISHED) {
    drupal_goto('&lt;front&gt;', array('query' =&gt; array('errCode' =&gt; 1)));
  }

  // Let the core node handler serve the request otherwise.
  return node_page_view($node);
}


Notes:


You should do this through a custom module instead of the theme.
Bear in mind that this might interfere with functionality of other modules, as well as workflows. See my comments and alternative version of the code.
Use drupal_goto() for redirection instead of setting the location in header.


Hope this helps.