[thelist] redirection based on domain (fwd)
Daniel J. Cody
djc at members.evolt.org
Thu Sep 6 00:13:42 CDT 2001
---------- Forwarded message ----------
Date: Thu, 06 Sep 2001 00:09:31 -0500
From: Susan Wallace <susanhw at webcastle.com>
To: thelist at evolt.org
Subject: redirection based on domain
Greetings!
I have a client hosted at (everyone's favorite) Interland. My client
recently purchased a new domain name to promote a book they published. At
the moment, the new domain is pointed at the "old domain" because what they
wanted to do was have the new domain point to a specific page within their
current side using redirection.
The server is CF enabled, and is running IIS 5.0. I know that it makes more
sense to do this server-side, however the folks at Interland told my client
that they could not do that, as "the webmaster needed to setup the script
to redirect instead." (And yes, I realize that it only takes 3 clicks.. )
Using CF, I can determine the value of CGI.SERVER_NAME and redirect based
on that, however, this seems too easy.
Here is my thinking:
User types in www.abc.com
index.cfm is the main page in the site, this triggers the Application.cfm
page (I am not using ANY CF on this site at all - this would be the only
reason.)
within Application.cfm, I have
<CFIF #CGI.SERVER_NAME# CONTAINS "abc.com">
<CFLOCATION URL="http://www.abc.com/newbook/index.html">
</CFIF>
Now, in this case, the main home page was index.html, so I renamed it to
index.cfm. This caused an issue with links in the site, so now I have this:
index.html - loads by default - within that page is a META Refresh to send
to index.cfm
index.cfm - main page of the site (calls Application.cfm to check domain
name and redirect if applicable)
Now... is there any instance where a browser would not support the META
Refresh?
Is there another way to do this that doesn't skew log reporting and
possible exclusion of visitors because of the Refresh?
I chose to use CF here because that's what I know, but I am not "married"
to it if there is a more graceful solution.
TIA!
Susan Wallace
More information about the thelist
mailing list