diff -x Root -x Repository -x Entries -x '*.rej' -x '*.orig' -u -N -r ./src/daemon/driver/driverCommands.ml ./src/daemon/driver/driverCommands.ml
--- ./src/daemon/driver/driverCommands.ml	2005-01-28 16:06:55.000000000 +0100
+++ ./src/daemon/driver/driverCommands.ml	2005-01-28 21:06:30.000000000 +0100
@@ -2197,22 +2197,47 @@
     
     
     "dllink", Arg_multiple (fun args o ->        
-        let buf = o.conn_buf in
+	 lprintf "dllink\n";
+	 let buf = o.conn_buf in
+	 let query_networks url = 
+	   if not (networks_iter_until_true
+	      (fun n -> 
+	                       try 
+	    network_parse_url n url
+	                       with e ->
+	    Printf.bprintf buf "Exception %s for network %s\n"
+	    (Printexc2.to_string e) (n.network_name);
+	    false
+	      )) then
+	            _s "Unable to match URL"
+	          else
+	            _s "done"
+	 in
         let url = String2.unsplit args ' ' in
         
-        if not (networks_iter_until_true
-              (fun n -> 
-                try 
-                  network_parse_url n url
-                with e ->
-                    Printf.bprintf buf "Exception %s for network %s\n"
-                      (Printexc2.to_string e) (n.network_name);
-                    false
-            )) then
-          _s "Unable to match URL"
-        else
-          _s "done"
-    ), "<link> :\t\t\t\tdownload ed2k, sig2dat, torrent or other link";
+       if (String2.starts_with url "http") then (
+         let u = Url.of_string url in
+         let module H = Http_client in
+         let r = {
+	    H.basic_request with
+    	    H.req_url =  u;
+	    H.req_proxy = !CommonOptions.http_proxy;
+	    H.req_request = H.HEAD;
+	    H.req_user_agent = 
+        	Printf.sprintf "MLdonkey/%s" Autoconf.current_version;
+         } in
+           H.whead r 
+          (fun headers ->
+         (* Combine the list of header fields into one string *)
+         let concat_headers = 
+           (List.fold_right (fun (n, c) t -> n ^ ": " ^ c ^ "\n" ^ t) headers "")  in
+           ignore (query_networks concat_headers)
+      );
+           _s "Parsing HTTP url..."
+       )
+       else
+         query_networks url
+     ), "<link> :\t\t\t\tdownload ed2k, sig2dat, torrent or other link";
     
     "dllinks", Arg_one (fun arg o ->        
         let buf = o.conn_buf in
diff -x Root -x Repository -x Entries -x '*.rej' -x '*.orig' -u -N -r ./src/networks/bittorrent/bTInteractive.ml ./src/networks/bittorrent/bTInteractive.ml
--- ./src/networks/bittorrent/bTInteractive.ml	2005-01-28 16:06:55.000000000 +0100
+++ ./src/networks/bittorrent/bTInteractive.ml	2005-01-28 21:04:30.000000000 +0100
@@ -282,12 +282,12 @@
   file
   
 let load_torrent_file filename =
+  lprintf "BTInteractive.load_torrent_file %s\n" filename;
   let s = File.to_string filename in  
   
   let download_filename = Filename.concat downloads_directory
       (Filename.basename filename) in
   File.from_string download_filename s;
-  lprintf "BTInteractive.load_torrent_file %s\n" download_filename;
   let file = load_torrent_string s in
   file.file_torr_fname <- download_filename
 
@@ -374,33 +374,38 @@
       BTClients.disconnect_clients file
     end
   ) !copy_shfiles
-    
+
+let valid_torrent_extension url = 
+  let ext = String.lowercase (Filename2.last_extension url) in
+    if ext = ".torrent" || ext = ".tor" then true else false
+
+let get_regexp_string text r = 
+  ignore (Str.search_forward r text 0);
+  let a = Str.group_beginning 1 in
+  let b = Str.group_end 1 in
+    String.sub text a (b - a)
   
 let _ =
   network.op_network_parse_url <- (fun url ->
-      let ext = String.lowercase (Filename2.last_extension url) in
-      lprintf "Last extension: %s\n" ext;
-      if ext = ".torrent" || ext = ".tor" then
-        try
-          lprintf "Trying to load %s\n" url;
-          load_torrent_file url;
-          true
-        with e ->
-            lprintf "Exception %s while loading\n" (Printexc2.to_string e);
+  (*lprintf "BT.op_network_parse_url";*)
+  let location_regexp = "Location: \([^\n]+\)\n" in
+  try let real_url = get_regexp_string url (Str.regexp location_regexp) in
+    if (valid_torrent_extension real_url) || 
+      (String2.contains url "Content-Type: application/x-bittorrent") then (
+	    let u = Url.of_string real_url in
             let module H = Http_client in
-	    let u = Url.of_string url in
             let r = {
                 H.basic_request with
                 H.req_url = u;
                 H.req_proxy = !CommonOptions.http_proxy;
                 H.req_user_agent = 
                 Printf.sprintf "MLdonkey/%s" Autoconf.current_version;
-        H.req_referer = (
+	H.req_referer = (
            let referers = !!BTOptions.referers in
            let (rule_search,rule_value) = try (List.find(fun (rule_search,rule_value) ->
-                           Str.string_match (Str.regexp rule_search) url 0
+                           Str.string_match (Str.regexp rule_search) real_url 0
                            ) referers )
-                           with Not_found -> ("",url) in
+                           with Not_found -> ("",real_url) in
                 Some (Url.of_string rule_value) ); 
 		H.req_headers = try
 		  let cookies = List.assoc u.Url.server !!BTOptions.cookies in
@@ -418,10 +423,21 @@
             lprintf "wget started\n";
             
             true
-      else
-        false
-  )
-  
+	    )
+    else
+      false
+    with Not_found -> 
+	if (valid_torrent_extension url) then
+	    try
+		load_torrent_file (Filename2.basename url);
+		true
+	    with e ->
+		lprintf "Exception %s while loading\n" (Printexc2.to_string e);
+		false
+	else
+	    false
+    )
+
 let _ = (
     client_ops.op_client_info <- (fun c ->
         let (ip,port) = c.client_host in
diff -x Root -x Repository -x Entries -x '*.rej' -x '*.orig' -u -N -r ./src/networks/fileTP/fileTPInteractive.ml ./src/networks/fileTP/fileTPInteractive.ml
--- ./src/networks/fileTP/fileTPInteractive.ml	2005-01-28 16:06:55.000000000 +0100
+++ ./src/networks/fileTP/fileTPInteractive.ml	2005-01-28 21:06:30.000000000 +0100
@@ -334,6 +334,46 @@
   end
   else
     false
+
+let is_http_torrent headers url =
+  let ext = String.lowercase (Filename2.last_extension url) in
+    if ext = ".torrent" || ext = ".tor" ||
+      (String2.contains headers "content-type application/x-bittorrent") then true else false
+
+let get_regexp_int text r = 
+  ignore (Str.search_forward r text 0);
+  let a = Str.group_beginning 1 in
+  let b = Str.group_end 1 in
+    int_of_string (String.sub text a (b - a))
+
+let get_regexp_string text r = 
+  ignore (Str.search_forward r text 0);
+  let a = Str.group_beginning 1 in
+  let b = Str.group_end 1 in
+    String.sub text a (b - a)
+
+let rec op_network_parse_url url = 
+  lprintf "filetp.op_network_parse_url\n";
+  let location_regexp = "Location: \([^\n]+\)\n" in
+  let real_url = get_regexp_string url (Str.regexp location_regexp) in
+    lprintf "real url: %s\n" real_url;
+  if (is_http_torrent url real_url) then false else    
+    if (String2.check_prefix real_url "http://") then (
+      lprintf "http download\n";
+      let length_regexp = "Content-Length: \([0-9]+\)\n" in
+ try let length = get_regexp_int url (Str.regexp length_regexp) in
+   if (length > 0) then begin
+     download_file real_url; true
+   end
+   else raise Not_found
+ with Not_found -> lprintf "Unknown file length. Use a web browser\n"; false
+    )
+    else if (String2.check_prefix url "ftp://") || (String2.check_prefix url "ssh://") then (
+      download_file url;
+      true
+    )
+    else
+      false
       
 let _ =
   network.op_network_parse_url <- op_network_parse_url
diff -x Root -x Repository -x Entries -x '*.rej' -x '*.orig' -u -N -r ./src/utils/net/http_client.ml ./src/utils/net/http_client.ml
--- ./src/utils/net/http_client.ml	2005-01-28 16:06:55.000000000 +0100
+++ ./src/utils/net/http_client.ml	2005-01-28 21:06:30.000000000 +0100
@@ -285,14 +285,14 @@
               with _ -> 
                   lprintf "bad content length [%s]\n" content;
         ) headers;
-        
-        let content_handler = content_handler !content_length headers in
+        let location = "Location", Url.to_string old_url in
+        let content_handler = content_handler !content_length (location::headers) in
         set_reader sock content_handler;
         let buf = TcpBufferedSocket.buf sock in
         if buf.len > 0 then
           content_handler sock buf.len 
     
-    | 302 | 304 ->
+    | 301 | 302 | 304 ->
         lprintf "Http_client %d: Redirect\n" ans_code;
         if level < 10 then
           begin
