[thelist] 2 Domain Names, 1 Host?
Ben Vigil
Ben Vigil" <ben at abelware.com
Wed, 1 Dec 1999 14:38:38 -0500
Leo:
In addition to what Jeremy mentioned, here are 2 more suggestions...
1) Your ISP could also set this up for you. This is usually called a
FakeIP.
2) But, assuming the hosting provider allows you CGI script access in
your document root directory, you could write a quick index.cgi to do
the redirection. This is what the file would look like:
---
#!/usr/bin/perl
my ($URL1) = 'http://www.wiedersheim.com/clicktech/index.html';
my ($URL2) = 'http://www.wiedersheim.com/index.html';
if ($ENV{'HTTP_HOST'} =~ /clicktech.com/gi)
{
print "Location: $URL1\n\n";
}
else
{
print "Location: $URL2\n\n";
}
exit;
---
You would also need to make sure of the path to PERL (the first line
above beginning with #!) on your host and that you are able to use
index.cgi as a default document like index.htm, index.html,
default.htm, etc...
____________________________________________________________
B E N V I G I L
<ben@abelware.com>
----- Original Message -----
From: Leo Wiedersheim <Leo.Wiedersheim@roxy.com>
To: <thelist@lists.evolt.org>
Sent: Wednesday, December 01, 1999 12:09 PM
Subject: [thelist] 2 Domain Names, 1 Host?
> Howdy,
> I know it is possible to have two domain names resolve to the same
host.
> However, I am wondering if it is possible to detect which URL a
person is
> coming from and redirect them to a certain page on that host. For
example,
> I currently have a virtual host with the domain name
> http://www.wiedersheim.com and I've acquired the name ClickTech.com.
If
> someone wants to go to wiedersheim.com, I'd like them to go to
> http://www.wiedersheim.com/index.html, if they want to go to
> http://www.clicktech.com, I'd like them to be redirected to
something like
> http://www.wiedersheim.com/clicktech/index.html
>
> Is that possible? If so, any hints as to how?
>
> Thanks a bunch.
>
> Leo.
> ~
> Leo P. Wiedersheim, Jr.
> leo@wiedersheim.com
> http://www.Wiedersheim.com
> http://www.CampaignCollectibles.com
>