<!--- If IP address... --->
<cfif isNumeric(replace(variables.domain, ".", "", "ALL"))>
No domain found.
<cfabort>
</cfif>
<!--- Get actual domain name, ignoring subdomain --->
<cfif listLen(cgi.http_host,'.') GT 1>
<cfset variables.domain = mid(cgi.http_host, find('.', cgi.http_host,1),
len(cgi.http_host))>
</cfif>
<cfswitch expression="#variables.domain#">
<cfcase value="foobar.com">
<cflocation
url="http://isbc.com/foobar#cgi.script_name##cgi.query_string#">
</cfcase>
etc...
</cfswitch>
or better yet, build a table in your database with a crossref between
directory and domain....
--
jon
mailto:[EMAIL PROTECTED]
Friday, September 5, 2003, 1:53:57 PM, you wrote:
NB> I recently moved some Web sites over to Intermedia.net. Hosting multiple
NB> domains at Intermedia.net URL's requires the URL's to be of the form
NB> "domainname.com/domainname" rather than the standard "domainname.com".
NB> Intermedia.net provides a script (shown below) to handle redirecting for
NB> the home pages. Unfortunately, when you have a site, like ours at isbc.com,
NB> where many have linked to individual pages within the site the script
NB> doesn't work for the individual pages.
NB> For example
NB> http://www.isbc.com/db/Search.cfm
NB> has to be reached using
NB> http://www.isbc.com/isbc/db/Search.cfm
NB> As there a 100's of Web pages involve, the concept of using an CFIF tag for
NB> every pages becomes very inefficient.
NB> Anyone know of a script or have any suggestions on how to create a more
NB> advanced script that would insert the extra info when it doesn't already exist?
NB> Thanks,
NB> Nick
NB> REDIRECT SCRIPT for Cold Fusion
NB> This is an example of default.cfm that will redirect the requests for
NB> different domains
NB> to appropriate directories.
NB> <CFIF FindNoCase("domain1.com","#CGI.SERVER_NAME#") GT 0>
NB> <CFLOCATION URL="/directory1">
NB> <CFELSEIF FindNoCase("domain2.com","#CGI.SERVER_NAME#") GT 0>
NB> <CFLOCATION URL="/directory2">
NB> <CFELSEIF FindNoCase("domain3.com","#CGI.SERVER_NAME#") GT 0>
NB> <CFLOCATION URL="/directory3">
NB> <CFELSE>
NB> You came to unknown domain.
NB> </CFIF>
NB>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics.
http://www.fusionauthority.com/signup.cfm