htdig: Frames and HTsearch: HOWTO

Dan Schleifer (
Thu, 17 Sep 1998 15:56:53 +0000

Ok, it seems to be a common problem that people need framesets to load
with the content that is being searched for, so here is the solution I
came up with. I have it set up on my site so that the header and side
bars are one directory down from the content pages and everything but
the content is excluded from being searched by htdig. The exclude line
in htdig.conf takes care of making sure nobody gets anything but the
content I want them to get. The change to sends the url

to the perl script instead of the browser, and the perl script takes the

url, gets the right header, side bar, and content and sends it all to
the browser. It seems to work real well. If anybody needs more
explaination, feel free to mail me.


This is what my exclude line in htdig.conf looks like:

exclude_urls: .txt .c.html .s.html .d.html .bak .gif .jpg main topics

Here is the change I made to in the htsearch source
directory (made the change then recompiled and installed):

 s << "<dl><dt><strong><a href=\"
            s << "$(STARSLEFT)\n";
            s << "</dt><dd>$(EXCERPT)<br>\n";
            s << "<i><a
            s << " <font size=-1>$(MODIFIED), $(SIZE) bytes</font>\n";
            s << "</dd></dl>\n";

This is a little perl script ( that I wrote and keep in

$path = $ENV{'PATH_INFO'};
$path =~ s/^\///;
@pathinfo = split(/\//, $path);
pop(@pathinfo); #@pathinfo[$#pathinfo];
pop(@pathinfo); #@pathinfo[--$#pathinfo];
$subpath = join("/", @pathinfo); #$path;
                                        #$subpath =~ s/$contentname//;
                                        #$subpath =~
print "Content-type: text/html\n\n";
print <<EOF;

ESIS WORKS <BODY> Viewing this page requires a browser capable of displaying frames. </BODY>


To unsubscribe from the htdig mailing list, send a message to containing the single word "unsubscribe" in
the body of the message.

This archive was generated by hypermail 2.0b3 on Sat Jan 02 1999 - 16:27:45 PST