  
      unless ( open STREAM, "<$release_path" )
      {
-@@ -777,6 +777,7 @@ sub process_index
+@@ -779,8 +779,10 @@ sub process_index
      my ( $path, $package, $mirror, $files ) = '';
  
      $path = sanitise_uri($uri);
-+    $path =~ s&^[^/]+/&&;
++    $path =~ s&^[^/]+/?&&;
      local $/ = "\n\n";
      $mirror = get_variable("mirror_path") . "/" . $path;
++    $path = $mirror;
  
-@@ -853,12 +854,12 @@ foreach (@config_sources)
+     if (-e "$path/$index.gz" )
+     {
+@@ -857,12 +859,12 @@ foreach (@config_sources)
          my $component;
          foreach $component (@components)
          {

diff --git a/apt-mirror b/apt-mirror
index 7d9ff5c..9c2f54f 100755
--- a/apt-mirror
+++ b/apt-mirror
@@ -263,7 +263,7 @@ sub download_urls

     }
 }
 
@@ -875,12 +877,12 @@ foreach (@config_binaries)
         my $component;
         foreach $component (@components)
         {
