V
V
vector20142020-10-30 13:52:07
Yandex
vector2014, 2020-10-30 13:52:07

How to make sure that only bots visit the main domain of the site?

How to make sure that only bots (Yandex Google and other services) visit the main domain of the site, and if a live person enters the site, he is redirected to a subdomain. If the bot has entered a subdomain, it is redirected to the main domain.

1) For bots - the main domain
2) For people - a subdomain

I wonder if it is necessary for each bot to prescribe its own settings (update the ip database, etc.) or is there a universal script in htacces for all bots?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cython, 2020-10-30
@vector2014

Search bots always send their own User-Agent header. Therefore, you can redirect the request depending on the User-Agent.
PHP
example htacess file example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question