2011-10-13 94 views

回答

7

這裏的基本思想是:如果域名只是`foo.com`

<cfset domain = cgi.server_name> 
<cfset subDomain = ""> 

<cfif ListFirst(domain, ".") neq "foo" and ListFirst(domain, ".") neq "www"> 
    <cfset subDomain = ListFirst(domain, ".")> 
</cfif>