#!/usr/local/perl588/bin/perl

################################################################
#                                                              #
#                      DomainDirector v1.1                     #
#          Copyright ©1999 - Tintagel Consulting, LLC          #
#                    dba Script Solutions                      #
#               http://www.scriptsolutions.com/                #
#                     All rights reserved                      #
#                                                              #
################################################################
#                                                              #
# PURPOSE OF PROGRAM:                                          #
#                                                              #
# DomainDirector v1.1 allows you to direct parked domains to a #
# subdirectory of a "primary" domain.                          #
#                                                              #
#                                                              #
# INSTRUCTIONS:                                                #
#                                                              #
# Installation instructions are in the readme.txt file that    #
# was included in this distribution.                           #
#                                                              #
#                                                              #
# LICENSE AGREEMENT:                                           #
#                                                              #
# By installing DomainDirector v1.1, you have                  #
# agreed to indemnify, defend, and hold harmless Tintagel      #
# Consulting, LLC dba Script Solutions from any and all        #
# liability, penalties, losses, damages, costs, expenses,      #
# attorneys' fees, causes of action or claims caused by or     #
# resulting indirectly from your use of this script which      #
# damages either you, or any other party or parties without    #
# limitation or exception. This indemnification and hold       #
# harmless agreement extends to all issues associated with     #
# this script.                                                 #
#                                                              #
################################################################


################################################################
#                                                              #
#                        EDIT BELOW                            #
#                                                              #
################################################################

$mainpage 	= "index.html";


%domains = (
	'www.paulcharbeneau.com'		=> 'paulcharbeneau/main.htm',
);





################################################################
#               DO NOT CHANGE BELOW THIS LINE!                 #
################################################################

$server = lc($ENV{'HTTP_HOST'});if ($ENV{'HTTP_HOST'} =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/){$t='/'}else{if ($server !~ /^www./){$server = 'www.' . $server;}}@domains = keys(%domains);foreach $domain(@domains){if ($domain eq $server){print "Location: http://${server}/$domains{$server}\n\n";$match="yes";last;exit}}unless ($match){print "Location: http://$server/$mainpage\n\n";exit}exit;