title: wget - Double downloads with query strings in URLs
body: <p>I have to use wget to download, with the recursive option (<code>-r</code>), all the files in a web page.</p>
  
  <p>This page contains N direct links to the N files (<a href="http://xxx.xxx.xxx.xxx/page/File_n.abc" rel="nofollow">http://xxx.xxx.xxx.xxx/page/File_n.abc</a>), but also contains other N "undirect" links (query strings) to theese files (<a href="http://xxx.xxx.xxx.xxx/page/File_n.abc?cd=at" rel="nofollow">http://xxx.xxx.xxx.xxx/page/File_n.abc?cd=at</a>).</p>
  
  <p>How can I avoid to download theese files (identical to the first ones). </p>
  
  <p>I tried the option <code>-R *cd*</code> but wget deletes the files <strong>after</strong> the download.
  I noticed that, using the option <code>-R *xyz*</code>, the program doesn't download any file containing "xyz", only if "xyz" is in the part of the link before the "<code>?</code>" symbol.
  Otherwise the program downloads the file and <strong>than</strong> deletes it.</p>
  
  <p>The <em>wget</em> <strong><em>manual</em></strong> says: "Note, too, that query strings (strings at the end of a URL beginning with a question mark (‘?’) are not included as part of the filename for accept/reject rules, even though these will actually contribute to the name chosen for the local file. It is expected that a future version of Wget will provide an option to allow matching against query strings."</p>
  
  <p>Any idea?</p>