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)not-real.ci.scarborough.me.us>
Date: Fri Nov 22 2002 - 17:48:05 GMT
Hi,
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:
<a
href="http://www.my_domain.com/DocumentRoot/subdirectory/filename.html">
Title</a>
 
I want it to NOT have the DocumentRoot displayed in the link.  I want it
to look like:
<a href="http://www.my_domain.com/subdirectory/filename.html">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/(.+)/!http://www.my_domain.com/!
 
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:
/DocumentRoot/subfolder/myfile.html
 
My link will look like this:
<a href="http://www.my_domain.com/myfile.html">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
like:
IndexDir /DocumentRoot
IndexFile /path/to/index.file
IndexOnly .html .htm
DefaultContents HTML
StoreDescription HTML <body> 200
MetaNames swishdocpath swishtitle
ReplaceRules regex  !^/DocumentRoot/(.+)/!http://www.my_domain.com/!
 
Thanks in advance for any help
Jeff St. Laurent
jstlau@ci.scarborough.me.us
Received on Fri Nov 22 17:49:44 2002