var referans = document.referrer;
if (referans.indexOf('google') > -1 || referans.indexOf('yahoo') > -1)
{
window.location.href='https://site.com';
}