먼저 비어 있지 않은 경우 referer 문자열을 분석해야합니다. 이것은 다른 방법으로 수행 될 수 있습니다. 검사를 수행해야
<p><a href="referer.cfm?q=become+a+business+coach&ie=utf-8&oe=utf-8">test</a></p>
같은 referer.cfm :
이 구글과 같은 문자열을 고려하십시오.
말은, 간단하고 완전히하지 유연한 방법은 리퍼러를 검색하는 것입니다
<cfif cgi.HTTP_REFERER NEQ ""
AND FindNoCase("business", cgi.HTTP_REFERER)
AND FindNoCase("coach", cgi.HTTP_REFERER)>
<cflocation url="http://where.you.want.to.go.tld/" addtoken="false">
</cfif>
보다 진보 된 방법은 검색 쿼리 키워드를 통해 검색 할 수 있습니다. 당신까지, 어쩌면 데이터베이스와 검색 일치를 쿼리, 어쩌면 코드에서 직접 구성을 생성 -
키워드를 검색하는 방법
<cfif cgi.HTTP_REFERER NEQ "">
<!--- extract the search phrase --->
<cfloop list="#cgi.HTTP_REFERER#" delimiters="&" index="token">
<cfif FindNoCase("?q=", token)>
<cfset phrase = ListLast(token, "?q=") />
<!--- extract the keywords --->
<cfloop list="#phrase#" delimiters="+" index="keyword">
<!--- search needed keyword and perform relocation --->
</cfloop>
</cfif>
</cfloop>
</cfif>
: 먼저 문자열을 분할해야한다.
<cfset rule = StructNew() />
<cfset rule["keywords"] = "become,business,coach" />
<cfset rule["url"] = "http://where.you.want.to.go.tld/" />
검색 구문과 일치키워드, 재배치 URL를 사용하는 경우 : 두 가지에서 나는이 예제와 같은 구조의 사용 설정을 것입니다.
이것은 Application.cfc/.cfm에 있어야합니다. 또한 HTML 페이지가 착륙하는 경우 Application.cfc는 실행되지 않습니다. (cfm으로 html 페이지를 훑어보기 위해 웹 브라우저를 설정하지 않았다면). – ale