Consider this example, which happens to be how I realised this problem:

wget http://www.mxpx.com/ -r --base=.

Here, I want the entire site to be downloaded with each link pointing
to the local file. This works for some links, but it does not take
references to the root directory into account, such as this:

<a href="/index.php">Home</a>

Here, wget just ignores the --base parameter and leaves the link as
"/index.php".

I realise that this may seem like a sticky situation, but consider
this solution: Let's say that I have a photo album on my personal
homepage with the following directory scheme:

/
/photos/
/photos/hawaii
/photos/concerts

In /photos/concerts/index.html, I have a link to "/index.html". When
wget parses the html, it could then become: "../../index.html". All we
need to know is how many directories deep we are.

Would this be an acceptable solution? If so, I'd be glad to write a patch.

Reply via email to