标签:20180531
一、配置防盗链配置文件增加如下内容
<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 /data/wwwroot/www.11.com/admin/>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Directory>
curl测试状态码为403则被限制访问了
核心配置文件内容
<Directory /data/wwwroot/www.11.com>
<FilesMatch "admin.php(.*)">
Order deny,allow
Deny from all
Allow from 127.0.0.1
</FilesMatch>
</Directory>
配置防盗链、访问控制– Directory及访问控制 – FilesMatch
标签:20180531
原文地址:http://blog.51cto.com/10690709/2122690