A
A
anface2018-12-05 21:37:00
htaccess
anface, 2018-12-05 21:37:00

How to disable direct visits to the site?

Hello. Please tell me how to disable all direct visits to the site in htaccess? Allow visits only from ps

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Vladimirovich, 2018-12-05
@spamboo

if (empty($_SERVER['HTTP_REFERER'])) {
 echo 'реферер или 0, или пусто, или вообще не определена';
}
else {
echo 'реферер есть :)';
}

you can still dig deeper and read here htaccess.ru/info/referral-blocking
via hitachch xs but the first thing that came to mind :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question