SSI
Zenon Panoussis <[email protected]>
| Newsgroups | gmane.comp.web.mnogosearch.general |
|---|---|
| Message-ID | <[email protected]> |
Hello all
I'm having trouble using SSI as per
http://www.mnogosearch.org/doc33/msearch-doingsearch.html#search-scriptname
and I would welcome some help.
(BTW, the include example on that page has a typo. It says
<--#include virtual="search.cgi">, but it should be
<--#include virtual="search.cgi"--> with two dashes also at the closing end.
Typical thing that people will copy/paste without noticing, just like I did).
Anyway, my httpd.conf says:F
ScriptAlias /cgi-bin/ /var/www/example.com/cgi-bin/
SetEnv UDMSEARCH_SELF /var/www/example.com/htdocs/index.html
PassEnv UDMSEARCH_SELF
SetEnv UDMSEARCH_TEMPLATE /etc/mnogosearch/search.htm
<Directory /var/www/example.com/htdocs>
Options +Includes
XBitHack on
</Directory>
The html page contains, well, a pile of html, and at the bottom of it
<--#include virtual="search.cgi"-->
The template search.htm doesn't contain any <html>, <head>, <body> opening tags,
nor any general "decorative" html, because these are already in the including
page. It starts with the section
<!--variables
...
-->
and then goes straight to
<!--top-->
<!IF name="form" CONTENT="extended">
<form method="get" action="">
The result is that the search page is rendered properly, but searching only
returns that very same initial empty search page, instead of producing a page
of results.
Assuming that <form action= should be set to something other than empty "",
I tried <form action="/index.html"> and <form action="$(Self)">. Neither works.
Using <form action=/cgi-bin/search.cgi"> produces raw results, obviously without
the formatting of index.html, but it proves that search itself works, that the
problem is in the SSI setup.
The problem makes sense to me. Every http operation is a simple one-shot
request-and-reply sequence, so if my SSI statement says #include virtual="search.cgi",
that's exactly what I'll get every time that the including page is loaded: the
output of search.cgi without any arguments. In order to get results, I think,
the SSI include statement should contain the query, like
<#include virtual="search.cgi?q=$&(q)&cmd=Search!>. But that's not possible, it
defies the whole idea of an SSI include in an otherwise static page.
So I wonder, has anyone gotten this to work? Can anyone see what I'm doing wrong?
Cheers,
Z