I'd like to mirror a site with wget and convert all the links to the local copies I've downloaded. So far that's easy all I have to do is wget -mk http://site.com

However all of the static media is located in a different domain, if I follow all of the foreign hosts using the -H option it will download that static media files, but it will also download anything else externally linked.

Is there a way to specify 'only download foreign hosts specified in list X'?

link|improve this question
feedback

2 Answers

See the section in the wget manpage after the --page-requisites option, it has an example:

Links from that page to external documents will not be followed. Actually, to download a single page and all its requisites (even if they exist on separate websites), and make sure the lot displays properly locally, this author likes to use a few options in addition to -p:

wget -E -H -k -K -p http://<site>/<document>
link|improve this answer
I tried the -p option, but still no luck – mountainswhim Feb 25 '10 at 3:37
should I take that to mean that you tried the -p option but ignored the section I quoted that tells you that you need a few more options and gives you an example? – Justin Feb 25 '10 at 4:41
exactly, I'm already using -k. -K does nothing more but backup files before converting them and -E just renames extensions if needed. As for -H, you can see my problem with that in my initial question. – mountainswhim Feb 25 '10 at 5:08
feedback

Add -Dwww.domain.com,static.domain.com with your equivalent domains.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.