.htaccess如何设置防盗链某个目录的图片

防止排除一些网站盗链某个目录的图片:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteCond %{HTTP_REFERER} !google.com [NC]
RewriteCond %{HTTP_REFERER} !baidu.com [NC]
RewriteCond %{HTTP_REFERER} !sogou.com [NC]
RewriteCond %{HTTP_REFERER} !soso.com [NC]
RewriteCond %{HTTP_REFERER} !youdao.com [NC]
RewriteCond %{HTTP_REFERER} !yahoo.cn [NC]
RewriteRule ^uploadfiles/(.*)\.(gif|jpg|png)$ http://www.aoyou0898.com/images/change.gif [L]

主要就是排除搜索引擎

你可能感兴趣的:(.htaccess如何设置防盗链某个目录的图片)