So, there is a page 1.php .

I do not know how to implement it, but I want to redirect bots.
If bots (Googlebot, YandexBot, bingbot) went to the 1.php page, then you first need to see if these are bots, then leave them on the same page.

And if these are not bots, then you need to load the include 1test.php page instead of 1.php.

Need to do this via php.

    1 answer 1

    The question is as old as the world, and solutions are complete.

    function isBot ($ua) { $engines = array( array('Aport', 'Aport'), array('Google', 'Google'), array('msnbot', 'MSN'), array('Rambler', 'Rambler'), array('Yahoo', 'Yahoo'), array('Yandex', 'Yandex'), array('Aport', 'Aport robot'), array('Google', 'Google'), array('msnbot', 'MSN'), array('Rambler', 'Rambler'), array('Yahoo', 'Yahoo'), array('AbachoBOT', 'AbachoBOT'), array('accoona', 'Accoona'), array('AcoiRobot', 'AcoiRobot'), array('ASPSeek', 'ASPSeek'), array('CrocCrawler', 'CrocCrawler'), array('Dumbot', 'Dumbot'), array('FAST-WebCrawler', 'FAST-WebCrawler'), array('GeonaBot', 'GeonaBot'), array('Gigabot', 'Gigabot'), array('Lycos', 'Lycos spider'), array('MSRBOT', 'MSRBOT'), array('Scooter', 'Altavista robot'), array('AltaVista', 'Altavista robot'), array('WebAlta', 'WebAlta'), array('IDBot', 'ID-Search Bot'), array('eStyle', 'eStyle Bot'), array('Mail.Ru', 'Mail.Ru Bot'), array('Scrubby', 'Scrubby robot'), array('Yandex', 'Yandex') ); foreach ($engines as $engine) { if (stristr($ua, $engine[0])) { return($engine[1]); } } return (false); } $isbot = isBot($_SERVER['HTTP_USER_AGENT']); if ($isbot) { echo 'А вы друг мой бот :)'; } else { echo 'Bastian одобряет, вы чел! :)'; } 

    It's pretty simple :)