Posted on 2016-10-24
I'm using CF 11.
I need to pull the URL that the page is on and see if there is a subdomain present. If so, I need to store that subdomain name, in a variable. I could easily do this in Perl or Python, but I have no idea how to do it in CF.
To be clear:
<cfset currentURL = "#CGI.SERVER_NAME#">
Let's say 'currentURL' has paul.beatles.com in it.
And I want to store 'paul' in a var to later check and see if 'paul' matches a particular string I'm looking for.
How would I do that in CF? Mostly I need to know how to pull 'paul' out of paul.beatles.com and store 'paul' in a var.