diff --git a/globalredirect.module b/globalredirect.module
index 715e90f..73d797c 100644
--- a/globalredirect.module
+++ b/globalredirect.module
@@ -289,7 +289,7 @@
    * @see http://drupal.org/node/205810
    * @see http://drupal.org/node/278615
    */
-  if ($_SERVER['SCRIPT_NAME'] != $GLOBALS['base_path'] .'index.php') {
+  if ($_SERVER['SCRIPT_FILENAME'] != getcwd() .'/index.php') {
     return FALSE;
   }
 