Escaping query strings with wget --mirror

Posted by Jeremy Banks on Super User See other posts from Super User or by Jeremy Banks
Published on 2011-02-07T09:10:22Z Indexed on 2011/03/17 8:12 UTC
Read the original article Hit count: 279

Filed under:
|
|

I'm using wget --mirror --html-extension --convert-links to mirror a site, but I end up with lots of filenames in the format post.php?id=#.html. When I try to view these in a browser it fails, because the browser ignores the query string when loading the file. Is there any way to replace the ? character in the filenames with something else?


The answer of --restrict-file-names=windows worked correctly. In conjunction with the flags --convert-links and --adjust-extension/-E (formerly named --html-extension, which also works but is deprecated) it produces a mirror that behaves as expected.

wget  --mirror --adjust-extension --convert-links --restrict-file-names=windows http://www.example

© Super User or respective owner

Related posts about linux

Related posts about wget