Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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