It so happens that you need to block access to the site from a particular site. If nginx is installed on the server, then this problem is solved in a couple of lines.
if ($ http_referer ~ * "example \ .com") { return 403; }
We consider in order. if is the if condition. $ http_referer is the referrer, the site from which the transition is made. "Example \ .com" is the address of the site being blocked. Return 403 returns to the browser that has switched from the site example.com an error page 403 - access is denied.
This code needs to be added to the server section of the config and reload this config with the command.
service nginx reload
This action will prevent transfers from example.com to your site.
How do you rate the article?
Thank you very much!
I wrote down for myself so.
# Ban on http_referer