Adding a rule

Hello

If there is a domain as example.com

I want to redirect the page to another site for my customers from the google search engine.
I want to redirect the page to another site for my customers coming from yandex search engine.

I want those who enter the domain from the browser to see the real site.

How can I do that ?

I’d just do this with HTACCESS directives.

For example:

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{HTTP_REFERER} ^https://some-domain-like-google.com [NC]
    RewriteRule .* "https://some-google-specific-site.com" [L,R]

    RewriteCond %{HTTP_REFERER} ^https://some-domain-like-yandex.com [NC]
    RewriteRule .* "https://some-yandex-specific-site.com" [L,R]
</IfModule>

Adjust the conditions/rules as-needed for your own use-case.