diff --git i/shurly.module w/shurly.module
index 43b6b2f..075d760 100644
--- i/shurly.module
+++ w/shurly.module
@@ -198,6 +198,7 @@ function shurly_boot() {
     elseif (variable_get('shurly_redirect_page', FALSE)){
       $row = db_query("SELECT rid, destination FROM {shurly} WHERE source = :q AND active = 0", array(':q' => $_GET['q']))->fetchObject();
       if ($row) {
+        global $base_url;
         $row->destination = $base_url . '/'. variable_get('shurly_redirect_page', FALSE) ."?d=".$row->destination;
         shurly_goto($row);
       }
