3

I have a website - http://myradio1.localhost and the directory is currently empty.

The virtual host works fine, no issues there.

This is my command I'm using to download the site via wget:

wget --user-agent="Googlebot/2.1 (+http://www.googlebot.com/bot.html)" -r --convert-links -p -P "C:\www\public_html\myradio1" "http://www.compassfm.co.uk"

It downloads the site perfectly, except for one thing, it always renders it like this when downloaded:

http://myradio1.localhost/www.compassfm.co.uk

which is not what I want to happen. I want it just to download to the folder, so it can run as http://myradio1.localhost, without me having to move the files out of the domain folder after download has completed.

How can I get wget to download all files, but without creating the domain as a folder, basically?

All help is much appreciated.

6

You need the parameter --no-host-directories or -nH, e.g.

wget --user-agent="Googlebot/2.1 (+http://www.googlebot.com/bot.html)" --no-host-directories -r --convert-links -p -P "C:\www\public_html\myradio1" "http://www.compassfm.co.uk"

From the manual:

-nH
--no-host-directories
Disable generation of host-prefixed directories. By default, invoking Wget with -r http://fly.srk.fer.hr/ will create a structure of directories beginning with fly.srk.fer.hr/. This option disables such behavior.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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