diff --git a/globalredirect.module b/globalredirect.module
index b799157..b9c0ab3 100644
--- a/globalredirect.module
+++ b/globalredirect.module
@@ -69,9 +69,9 @@ function globalredirect_init() {
   if (function_exists('language_url_rewrite')) {
     // Note 1 : the language_url_rewrite() takes path (by reference) as the
     //          first argument but does not use it at all
-    // Note 2 : We use $_REQUEST['q'] here as we want the path in an untouched
+    // Note 2 : We use request_path() here as we want the path in an untouched
     //          form ($_GET['q] gets modified by core)
-    $path = isset($_REQUEST['q']) ? $_REQUEST['q'] : '';
+    $path = request_path() ? request_path() : '';
     language_url_rewrite($path, $options);
   }
   $prefix = rtrim($options['prefix'], '/');
@@ -80,7 +80,7 @@ function globalredirect_init() {
   if (drupal_is_front_page()) {
     // Redirect if the current request does not refer to the front page in the
     // configured fashion (with or without a prefix)
-    if (isset($_REQUEST['q']) && $_REQUEST['q'] != $prefix) {
+    if ( request_path() && request_path() != $prefix) {
       drupal_goto('', $options, 301);
     }
     elseif ($settings['nonclean_to_clean'] &&
@@ -170,7 +170,7 @@ function globalredirect_init() {
 
   // Find an alias (if any) for the request
   $langcode = isset($options['language']->language) ? $options['language']->language : '';
-  $alias = drupal_get_path_alias($request, $langcode);
+    $alias = drupal_get_path_alias($request, $langcode);
 
   // TODO: This looks wrong for D7... maybe a hook?
   if (function_exists('custom_url_rewrite_outbound')) {
@@ -192,9 +192,9 @@ function globalredirect_init() {
 
   // Compare the request to the alias. This also works as a 'deslashing'
   // agent. If we have a language prefix then prefix the alias
-  if ($_REQUEST['q'] != $prefix . $alias) {
+  if (request_path() != $prefix . $alias) {
     // If it's not just a slash or user has deslash on, redirect
-    if (str_replace($prefix . $alias, '', $_REQUEST['q']) != '/' || $settings['deslash']) {
+    if (str_replace($prefix . $alias, '', request_path()) != '/' || $settings['deslash']) {
       drupal_goto($alias, $options, 301);
     }
   }
@@ -215,13 +215,13 @@ function globalredirect_init() {
   if ($settings['canonical']) {
      drupal_add_html_head_link(array(
       'rel' => 'canonical',
-      'href' => url(drupal_is_front_page() ? '<front>' : $_REQUEST['q'], array('absolute' => TRUE, 'query' => $query_string)),
+      'href' => url(drupal_is_front_page() ? '<front>' : request_path(), array('absolute' => TRUE, 'query' => $query_string)),
     ));
   }
 
   // Add the Content-Location header to the page
   if ($settings['content_location_header']) {
-    drupal_add_http_header('Content-Location', url(drupal_is_front_page() ? '<front>' : $_REQUEST['q'], array('absolute' => TRUE, 'query' => $query_string)));
+    drupal_add_http_header('Content-Location', url(drupal_is_front_page() ? '<front>' : request_path(), array('absolute' => TRUE, 'query' => $query_string)));
   }
 }
 
