Home: Perl Programming Help: Beginner:
Cobalt Enviroment Variables


Mar 15, 2001, 3:37 AM

Views: 743
Cobalt Enviroment Variables

Would any one know what $ENV Variable will
get the subdomain if wildcards are tured on?

it should be REDIRECT_URL or HTTP_HOST but
REDIRECT_URL is not working on this server
it prints out the current document name not
where it came from - this messes with the
ERROR script and the redirect service I'm trying
to get going.

I read someplace last year that Cobalt servers
don't use some perl Variables or have alternative
Variables in there place - what would be the right
name for REDIRECT_URL veriables on a cobalt server??

here is some info on the server:
Server Info

this redirect should work but don't:



Mar 22, 2001, 12:14 PM

Views: 730
Re: Cobalt Enviroment Variables

I believe you want HTTP_HOST, this will have the requested hostname from the URL.

How ever cobalt has a weird rewrite setup in apache where if the hostname is not matched to what you set it up as then it will redirect to the correct hostname.

e.g. you view
http://somedomain.com or http://somesub.somedomain.com

the cobalt RAQ will redirect to


You will need to remove the rewrite for the domain from the /etc/httpd/conf/httpd.conf file first.

You can use something like the following to show you all $ENV vars.

print "Content-type: text/html\n\n";
foreach $key(keys %ENV) {
print "$key: $ENV{$key}