一、配置防盗链
配置文件增加如下内容
<Directory /data/wwwroot/11.com>
SetEnvIfNoCase Referer "http://www.11.com" local_ref
SetEnvIfNoCase Referer "http://11.com" local_ref
SetEnvIfNoCase Referer "^$" local_ref
<filesmatch ".(txt|doc|mp3|zip|rar|jpg|gif)">
Order Allow,Deny
Allow from env=local_ref
</filesmatch>
</Directory>
二、访问控制 – Directory
核心配置文件内容
<Directory /data/wwwroot/www.11.com/admin/>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Directory>
curl测试状态码为403则被限制访问了
三、访问控制 – FilesMatch
核心配置文件内容
<Directory /data/wwwroot/www.11.com>
<FilesMatch "admin.php(.*)">
Order deny,allow
Deny from all
Allow from 127.0.0.1
</FilesMatch>
</Directory>
原文地址:http://blog.51cto.com/10690709/2122690
时间: 2024-10-22 13:17:39