D
D
Danil Ostapenko2019-03-20 02:11:44
htaccess
Danil Ostapenko, 2019-03-20 02:11:44

Prohibition of direct access to the site, except for those who came from search engines in htaccess?

Good day, tell me, I can’t figure it out, I’ve googled everything, there are bans for search engines everywhere, but nowhere is it written how to skip a user if he came from a search engine. As I understand it, you can create the following code:

Order Deny,Allow
Deny from all

And to register a list of exceptions, only in the vastness of the network there are lists for search bots, as you understand, it is necessary for those who, according to the referral from the search, go to allow? Tell me how to implement or how to correctly form a query for the search?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2019-03-20
@Arh1diablo

Well, as a rule, if the referrer is empty, then this is a direct entry:

RewriteEngine on 
RewriteCond %{HTTP_REFERER} ^$ 
RewriteRule^- [F,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question