According to Harrell, Roger:
> Is there any way to force htdig to use a certain config file if the request
> comes from a certain domain? I've got htdig running on about 8 different
> domains all using different config files. It works great except sometimes it
> seems to get requests that don't specify the config file (not sure how
> that's hapening since all of my forms specify the config file). Who knows if
> it's robots, someone mucking around or what. The trouble is it results in a
> lot of 404 errors since it uses the default config file and the header and
> footer are wrong and reference graphics that don't exist for most domains.
> Since I have a script that logs 404s to a database so I can track em down
> this is a pain. Anyway enough rambling why I want to do this, is it
> possible?

The easiest way I can think of is to use a wrapper script for htsearch.
E.g.:

#!/bin/sh
case "$QUERY_STRING" in
*config=*)      ;;
*)              export QUERY_STRING="$QUERY_STRING&config=$SERVER_NAME" ;;
esac
exec "$0"-real ${@+"$@"}

This would require using the GET method whenever you call the htsearch
wrapper script, and calling the config files by the full domain name
of your virtual servers (e.g. www.widgetsrus.com.conf).  Of course,
you could make the script as elaborate as you want.  This script doesn't
force the config file name if one is given, only if it's not specified.
If you want to force it unconditionally, you could use something like

QUERY_STRING="`echo $QUERY_STRING | sed -e 
's/\(.*\)[&;]config=[^&;]*[&;]\(.*\)/\1\&\2/'`
export QUERY_STRING="$QUERY_STRING&config=$SERVER_NAME"

If you don't want to mess with scripts, you can always make minor changes
to htsearch/htsearch.cc to change the way it gets the config file name.

-- 
Gilles R. Detillieux              E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/
Dept. Physiology, U. of Manitoba  Winnipeg, MB  R3E 3J7  (Canada)


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a 
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html

Reply via email to