HTML BASE HREF tags

You can use the preserve-base-href and the preserve-base-href2 entries in the [server] stanza to control how WebSEAL handles the HREF attributes of HTML BASE tags in filtered HTML documents.

Note: The value of preserve-base-href2 has no effect unless the preserve-base-href option is set to "yes".

When preserve-base-href is set to "no", the following statements apply:

Example 1 (BASE HREF matches a junctioned server)

HTML before filtering:

<HTML>
<HEAD>
<BASE HREF="http://www.example.com/dir1/dir2/"> 
</HEAD>
<BODY>
<A HREF="index.html">index.html</A>
</BODY>
</HTML>

HTML after filtering:

<HTML>
<HEAD>
<BASE> 
</HEAD>
<BODY>
<A HREF="/jct/dir1/dir2/index.html">index.html</A>
</BODY>
</HTML>

Example 2 (BASE HREF does not match a junctioned server)

HTML before filtering:

<HTML>
<HEAD>
<BASE HREF="http://www.example2.com/dir1/dir2/"> 
</HEAD>
<BODY>
<A HREF="index.html">index.html</A>
</BODY>
</HTML>

HTML after filtering:

<HTML>
<HEAD>
<BASE> 
</HEAD>
<BODY>
<A HREF="http://www.example2.com/dir1/dir2/index.html">index.html</A>
</BODY>
</HTML>

When preserve-base-href is set to "yes", the following statements apply:

Example 3 (URI Encoded, slash-escaped and Special Character URLS)

  • WebSEAL server: www.webseal.com
  • The following junction was created:
    server task webseal-server create -tcp -h www.example.com /jct

HTML before filtering:

<HTML>
<HEAD>
<BASE HREF="http://www.example2.com/dir1/">
</HEAD>
<BODY>
<A HREF="dir2%2Findex.html">index.html</A>
<A HREF="dir2\/contents.html">contents.html</A>
<A HREF="dir2&#x2F;index2.html">index2.html</A>
</BODY>
</HTML>

HTML after filtering:

<HTML>
<HEAD>
<BASE>
</HEAD>
<BODY>
<A HREF="http://www.example2.com/dir1/dir2/index.html">index.html</A>
<A HREF="http://www.example2.com/dir1/dir2/contents.html">contents.html</A>
<A HREF="http://www.example2.com/dir1/dir2/index2.html">index2.html</A>
</BODY>
</HTML>

Example 4 (BASE HREF matches a junctioned server)

HTML before filtering:

<HTML>
<HEAD>
<BASE HREF="http://www.example.com/dir1/dir2/"> 
</HEAD>
<BODY>
<A HREF="index.html">index.html</A>
</BODY>
</HTML>

HTML after filtering:

<HTML>
<HEAD>
<BASE HREF="http://www.webseal.com/jct/dir1/dir2/"> 
</HEAD>
<BODY>
<A HREF="index.html">index.html</A>
</BODY>
</HTML>

Example 5 (BASE HREF does not match a junctioned server)

HTML before filtering:

<HTML>
<HEAD>
<BASE HREF="http://www.example2.com/dir1/dir2/"> 
</HEAD>
<BODY>
<A HREF="index.html">index.html</A>
</BODY>
</HTML>

HTML after filtering:

<HTML>
<HEAD>
<BASE HREF="http://www.example2.com/dir1/dir2/"> 
</HEAD>
<BODY>
<A HREF="index.html">index.html</A>
</BODY>
</HTML>

Example 6 (URI Encoded, slash-escaped and Special Character URLs)

HTML before filtering:

<HTML>
<HEAD>
<BASE HREF="http://www.example.com/dir1/">
</HEAD>
<BODY>
<A HREF="dir2%2Findex.html">index.html</A>
<A HREF="dir2\/contents.html">contents.html</A>
<A HREF="dir2&#X2F;index2.html">index2.html</A>
</BODY>
</HTML>

HTML after filtering:

<HTML>
<HEAD>
<BASE HREF="http://www.webseal.com/jct/dir1/">
</HEAD>
<BODY>
<A HREF="dir2/index.html">index.html</A>
<A HREF="dir2/contents.html">contents.html</A>
<A HREF="dir2/index2.html">index2.html</A>
</BODY>
</HTML>