HTTrack Website Copier
Free software offline browser - FORUM
Subject: problem with <base href > and absolute urls, bug?
Author: Remke Rutgers
Date: 11/22/2002 10:58
 
Hello,

We use HTTrack quite a lot to create static versions of 
dynamic websites. (To be put on a cd or a website without 
an application server)
I just discovered a problem when mirroring a web page 
containing a base href tag and absolute urls.
I am using the latest version, 3.22-3.

Suppose my source contains (the file is requested using 
<http://www.somesite.com/subdir/page.cfm>):
<base href=http://www.somesite.com/subdir/

And in the source there are also absolute references:
<script language="JavaScript" 
src="/csjs/basiclayer.js"></script>
or 
<IMG BORDER="0" 
NAME="NameButtonE998C1886A1645FFB622239649C47CCF" 
SRC="/pics/general/nav/exit_n.gif">

Now in the mirrored page the source contains:
<base > 

and:
<script language="JavaScript" 
src="csjs/basiclayer.js"></script>

<IMG BORDER="0" 
NAME="NameButtonE998C1886A1645FFB622239649C47CCF" 
SRC="pics/general/nav/exit_n.gif">

So absolute urls are translated into relatieve urls taking 
the base href as the root.
As far as I know the base href should only be used for 
relative urls. At least that is how a browser does it. Am I 
correct?
I temporarily solved the issue by removing the <base href> 
tag from my source. 

Now there is no longer a base href tag in the mirrored 
source code and the urls are correct relative urls:
<script language="JavaScript" 
src="../csjs/basiclayer.js"></script>

<IMG BORDER="0" 
NAME="NameButtonE998C1886A1645FFB622239649C47CCF" 
SRC="../pics/general/nav/exit_n.gif">

By the way, in the history for HTTrack for version 3.20 I 
noticed the following line:
+ Fixed: "base href" with absolute uris
I could not find more info on what the problem was in 
previous versions, but it may be related to my problem?
Thanks for a very useful program.

Remke Rutgers 
 
Reply


All articles

Subject Author Date
problem with <base href > and absolute urls, bug?

11/22/2002 10:58




e

Created with FORUM 2.0.11