Skip to main content.
home | support | download

Back to List Archive

Need help with swish.cgi v2.2.1

From: Jeff St. Laurent <JStlau(at)>
Date: Fri Nov 22 2002 - 17:48:05 GMT
I'm using the standard swish.cgi with no alterations. I'm also using a
.swishcgi.conf file that looks like:
        title           => 'My Title',
        swish_index     => '/path/to/my/indexfile',
        display_props   => [qw/swishlastmodified swishdocsize/]
It's working, but I can't figure out how to correctly alter the
hyperlink source that gets returned on the results page.  It was
outputting something like this:
I want it to NOT have the DocumentRoot displayed in the link.  I want it
to look like:
<a href="">Title</a>
So, I did some digging and found the ReplaceRules Directive which can be
used in the conf file.  So, I tried putting in:
ReplaceRules regex  !^/DocumentRoot/(.+)/!!
This works a bit better, but never includes any subdirectories (if any)
after my DocumentRoot.  So, if my search returns a file whose actual
filepath is:
My link will look like this:
<a href="">Title</a>
So, documents are never linked correctly unless they live directly in
DocumentRoot.  So, I'm guessing that I'm getting warmer, but I'm not
quite there.  Any help would be much appreciated.  My conf file looks
IndexDir /DocumentRoot
IndexFile /path/to/index.file
IndexOnly .html .htm
DefaultContents HTML
StoreDescription HTML <body> 200
MetaNames swishdocpath swishtitle
ReplaceRules regex  !^/DocumentRoot/(.+)/!!
Thanks in advance for any help
Jeff St. Laurent
Received on Fri Nov 22 17:49:44 2002