Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Apache configuration hotlink protection

Shulou Source: shulou.com Published: 2022-06-01 05:35:35 11月25日 Update

How to set hotlink protection to prevent others from stealing pictures and videos, and what should be done?

1. Open the virtual host configuration file

Vi / usr/local/apache2/conf/extra/httpd-vhosts.conf

Add content

SetEnvIfNoCase Referer "^ http://.*\.test\.com" local_ref

SetEnvIfNoCase Referer ". *\ .lizheng\ .com" local_ref

Order Allow,Deny

Allow from env=local_ref

Deny from all

two。 Restart and load

Apachectl-t

Apachectl graceful

3. Refresh the page

4. To enable yourself to view pictures, put your domain name on the whitelist

Refresh the web page to display normally

Tags: Picture configuration anti-theft host content list domain name file web page virtual host video page Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple NVidia Huawei Docker MariaDB