I have a couple of questions... First, based on what you say here:
So I'm developing a backend CGI script that several virtual hosts will need to hit.
it seems that your script is NOT running on a virtual host but is being accessed (via HTTP) by other virtual hosts, and the behavior of your script is dependent on what virtual host is making the call. Is that correct?

Secondly, when you write:

I guess I could go by the referer for the CGI object
do you mean $ENV{HTTP_REFERER} or $ENV{REMOTE_HOST}?

In any case, my approach would be to develop a small rule engine that would allow your customize it for subdomains if you ever needed to:

my %domain_map; $domain_map{'yahoo.com'} = ...default setting for all of yahoo.com... $domain_map{'special.yahoo.com'} = ...special setting for special.yaho +o.com... sub find_setting { my $domain = shift; # either from $ENV{HTTP_REFERER} or $ENV{REMOTE +_HOST} my $setting; while (length($domain)) { defined($setting = $domain_map{$domain}) && last; $domain =~ s/^(.*?)(\.|\z)//; } return $setting; }

In reply to Re: Telling different virtual hosts apart by pc88mxer
in thread Telling different virtual hosts apart by ayapejian

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.