--- globalredirect.dev.module	2007-02-06 01:46:30.000000000 +0100
+++ globalredirect.module	2007-02-25 12:55:04.335441900 +0100
@@ -29,7 +29,7 @@ function globalredirect_init() {
     //Lets do a check to compare the current url to the site's frontpage.
     //  If matches, redirect to the frontpage (eg, http://www.mysite.com/)
     if(drupal_is_front_page()) {
-      header("HTTP/1.1 301 Moved Permanently");
+      drupal_set_header("HTTP/1.1 301 Moved Permanently");
       drupal_goto('', $query_string);
     }
 
@@ -38,7 +38,7 @@ function globalredirect_init() {
     //Check the current url (eg, node/123) for an alias... If set, redirect to it
     $alias = drupal_get_path_alias($_REQUEST['q']);
     if ($alias != $_REQUEST['q']) {
-      header("HTTP/1.1 301 Moved Permanently");
+      drupal_set_header("HTTP/1.1 301 Moved Permanently");
       drupal_goto($alias, $query_string);
     }
     
@@ -49,7 +49,7 @@ function globalredirect_init() {
       $alias = drupal_get_path_alias(substr($_REQUEST['q'], 0, -1));
       if ($alias != $_REQUEST['q']) {
         //We matched an alias for the current URL with no slash - redirect to that...
-        header("HTTP/1.1 301 Moved Permanently");
+        drupal_set_header("HTTP/1.1 301 Moved Permanently");
         drupal_goto($alias, $query_string);
       }
     }
