Monthly Archives: December 2011

wget mirroring with external references

I was having trouble mirroring a website that had all its images hosted on a different domain, which happened to be random subdomains of  I tried adding * to the -D parameter, but that didn’t work.  It turns out it’s smart enough to figure out that all subdomains in the domain list should be included as well:

wget -mkpEK -D, -H -t 3 \

This goes into mirror mode, changes relative links to the proper form, fixes the query string urls to static ones, and downloads all files from the domains in the -D parameter.  The manpage details all of this.