I need a CFM script to place on my website homepage.
If a visitor arrives from a search engine using a a certain search
phrase, I want to redirect them to various pages.
For example:
The following searches would redirect to the following pages:
become a business coach -> http://www.businesscoach.com/BusinessCoaching.html
find a business coach ->
http://www.businesscoach.com/go/bc/find-a-business-coach/index.cfm
please help me to do this…
Thanks
First you need to analyze the referer string, if not empty. This can be done in different ways.
Consider this Google-like string:
Same referer.cfm should perform the check.
Say, simplest and totally not flexible way is to search through the referer:
More advanced approach can be the search through the search query keywords. First you should split the string:
How to search the keyword — up to you, maybe query the database and search matches, maybe create configuration directly in code. In both ways I’d used set of structures like this example:
When keywords match the search phrase, use url to relocate.