diff --git a/shurly.module b/shurly.module
index f0c6a74..61b2f1d 100644
--- a/shurly.module
+++ b/shurly.module
@@ -199,7 +199,8 @@ function shurly_boot() {
       $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;
+        $domain = variable_get('shurly_base', $base_url);
+        $row->destination = $domain . '/'. variable_get('shurly_redirect_page', FALSE) ."?d=".$row->destination;
         shurly_goto($row);
       }
     }
