Home / PHP & Wordpress / 通过.htaccess防止wordpress图片文件盗链
原文是英文,为:
The first thing to do is to create a small image saying something like “Please do not hotlink from my server”. and upload it on your blog server.Then, we’ll have to edit the .htaccess file, located in your WordPress blog root directory. When modifying .htaccess, always create a backup.
作者网址为:http://www.wprecipes.com/how-to-protect-your-wordpress-blog-from-hotlinking
翻译成中文以后,具体实现方法就是先下载网站目录下的.htaccess,用记事本打开后,添加以下这段代码:
替换mysite为自己的网址和/images/notlink.jpg为自己定制的防盗链声明图片,然后重新上传覆盖就可以了,这个方法很简单,却可以为你节约大量的流量,其中可以增加更多的格式,比如zip,rar等等。
转载原创文章请注明,转载自:SKY [https://www.2sk.com/]
本文链接: https://www.2sk.com/websites/phpwordpress/nonlink.html
先做站一年。然后再使用防盗链
老帖新发
因为觉得很重要的各功能,所以留着了,而且有的时候服务器更新了会丢失原来添加的htaccess内容,利于重新补上,呵呵