PHP Redirection Script based on Referer

PHP Redirection Script based on Referer

Closed - This job posting has been filled and work has been completed.

Job Description

I need a simple PHP script that would enable me to redirect surfers based on keywords in referer.

Example

if 'blue' is in referrer
redirect surfer to abc.com/bluestuff.php
if 'black' is in referrer
redirect surfer to blackwidgets.com/
Else: there is no redirection

So let's say surfer comes from
https://www.google.ca/search?q=black+widget
he is sent to blackwidgets.com/

So let's say surfer comes from
https://www.google.ca/search?q=white+widget
he is not redirected (He sees the page where the script is located)

* I need to be able to set multiple rules in the same PHP script
* I need to be able to redirect to any URL (not just within the same domain)
* Script has to be easily editable (please make it easy for me to update).

This is mainly to use with google search referrers but it would be cool if the script was detecting keyword in any refered (example if customer comes from blackstuff.com we rerirect him to blackwidgets.com (because keyword 'black' is in domain name of blackstuff.com)

Thanks