I get a Coldfusion error each time someone (or something) comes to my site with no agent user declared.
This is my code around line 17:
Any ideas how to prevent this error?
Code:
CF Error: Invalid list index 1. In function ListGetAt(list, index [, delimiters]), the value of index, 1, is not a valid as the first argument (this list has 0 elements). Valid indexes are in the range 1 through the number of elements in the list. <br>The error occurred on line 17.
This is my code around line 17:
Code:
<!--- 301 redirect to [URL unfurl="true"]www version[/URL] of site, cgi.http_host gives you [URL unfurl="true"]www.mydomain.com[/URL] --->
<cfif domain NEQ "[URL unfurl="true"]www.mydomain.com"[/URL] AND NOT ISDEFINED("URL.cs")>
<!--- set nonwwws to what is possibly a subdomain or ad id --->
<cfset nonwwws = listGetAt(domain, 1, ".")>
<cfif nonwwws EQ "rentvine">
<cfheader statuscode="301" statustext="Moved permanently">
<cfheader name="Location" value="[URL unfurl="true"]http://www.#widgetURL#/">[/URL]
</cfif>
</cfif>
Any ideas how to prevent this error?