diff --git a/FeedsCrawler.inc b/FeedsCrawler.inc
index 4d70f06..0ddb310 100755
--- a/FeedsCrawler.inc
+++ b/FeedsCrawler.inc
@@ -102,16 +102,22 @@ class FeedsCrawler extends FeedsHTTPFetcher {
       }
     }
     if (strpos($href, 'http://') !== 0 && strpos($href, 'https://') !== 0) {
-      $href = ltrim($href, '/');
-      $href = $this->baseUrl($source_url) . '/' . $href;
+      if (substr($href, 0, 1) == '/') {
+        $href = ltrim($href, '/');
+        $href = $this->baseUrl($source_url) . '/' . $href;
+      }
+      else {
+        $href = $this->baseUrl($source_url, TRUE) . '/' . $href;
+      }
     }
     return $href;
   }
 
   /**
-   * Breaks a url up removing everything but the http://example.com.
+   * Breaks a url up removing everything but the http://example.com
+   * or the relative url base if $relative == TRUE.
    */
-  private function baseUrl($url) {
+  private function baseUrl($url, $relative = FALSE) {
     $p = parse_url($url);
     $output = '';
     $output .= isset($p['scheme']) ? $p['scheme'] : 'http';
@@ -121,6 +127,9 @@ class FeedsCrawler extends FeedsHTTPFetcher {
     $output .= isset($p['user']) ? '@' : '';
     $output .= $p['host'];
     $output .= isset($p['port']) ? ':' . $p['port'] : '';
+    if ($relative) {
+      $output .= isset($p['path']) ? substr($p['path'], 0, strrpos($p['path'], '/')) : '';
+    }
     return $output;
   }
 
