hook_init for node redirect
You can implement hook_init in a custom module. 

function my_module_init() {
  // Since this file should only be loaded on the front page, it cannot be
  // declared in the info file.
  if (drupal_is_front_page()) {
    drupal_add_css(drupal_get_path('module', 'foo') . '/foo.css');
  }
}


But note that this WILL NOT work if the page is cached or if you are using a revers proxy cache. If you need to do this on cached pages look into using hook_boot

That being said, there is often better ways to accomplish a redirect based on certain conditions. Update your question with more details and perhaps we can find more suitable solutions.