>- see footer for list info -<
The SERVERNAME is only the domain name.
So it could be
www.betenoir.net
Or
Betenoir.net
Depending how the site is accessed.
I suggest you do
<cfif CGI.SERVER_NAME does not contain "betenoir.net">
<cfset request.test_status = "true">
</cfif>
What I personally do is have a config file for each server. So that you do
not need to do tests and code changes between live and dev, just include the
appropriate config file, which contains all the global settings and
variables.
And I always redirect any other possible domains to the primary doamin. So
if someone does request betenoir.net, betenoir.co.uk, www.betenoir.co.uk etc
then I redirect to www.betenoir.net
Here is a basic example.
<cfif CGI.SERVER_NAME IS "www.betenoir.net">
<!--- live server --->
<cfinclude template="includes/config_live.cfm">
<cfelseif CGI.SERVER_NAME IS "staged.betenoir.net">
<!--- staging server --->
<cfinclude template="includes/config_staged.cfm">
<cfelseif CGI.SERVER_NAME IS "dev.betenoir.net">
<!--- development server --->
<cfinclude template="includes/config_dev.cfm">
<cfelse>
<!--- it was none of the above, so lets redirect to live --->
<cflocation url="http://www.betenoir.net/">
</cfif>
-
Russ
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Damien Gallagher
Sent: 06 July 2006 10:01
To: Coldfusion Development
Subject: [CF-Dev] CGI.SERVERNAME
>- see footer for list info -<
Morning all,
I have the code below on my site to check whether a transaction is going
through on the live server. If it's not on live, then the test_status param
is set to true and the transaction dealt with accordingly.
<cfset request.liveServer = "http://www.betenoir.net">
<cfif CGI.SERVER_NAME neq "#request.liveServer#">
<cfset request.test_status = "true"> </cfif>
Problem is, very occasionally, a transaction comes from the live server but
is being flagged as a test in the code block above. How can this be?
Does CGI.SERVER_NAME sometimes not work?
Thanks, Damien
_______________________________________________
For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo
--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help
>-<
_______________________________________________
For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo
--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<