One: Configure the anti-theft chain
Open the virtual host configuration file
#vim/usr/local/apache2/conf/extra/httpd-vhosts.conf
Add the following content
Setenvifnocase Referer "^http://.*\.abc\.com" Local_ref
Setenvifnocase Referer ". *.aminglinux.com" Local_ref
Setenvifnocase Referer "^$" Local_ref #没有referer, direct address
<filesmatch ". (txt|doc|mp3|zip|rar|jpg|gif|png) ">
Order Allow,deny
Allow from Env=local_ref
</filesmatch>
II: Access Control directory
Configuration file Contents
<Directory/data/wwwroot/www.123.com/admin/>
Order Deny,allow #按顺序执行, final entry into force
Denu from all
Allow from 127.0.0.1
</Directory>
Three: Access control FilesMatch
Configuration file Contents
<Directory/data/wwwroot/www.123.com/admin/>
<filesmatch admin.php (. *) >
Order Deny,allow #按顺序执行, final entry into force
Denu from all
Allow from 127.0.0.1
</FilesMatch>
</Directory>
Apache configuration anti-theft chain, access control directory, access control FilesMatch