防盗链是需要的,有些时候我们主机使用率不高,流量也不高,但就发现流量超标。尤其是国外主机,流量和CPU限制,大小不限制。
所以还是必须设置防止盗链的,尤其是图片比较多的网站。
Lunarpages主机设置防盗链步骤:
1.登陆cPanel
2. 点击HotLink Protection 进入防盗链设置
3. 第一行显示防盗链是否启用 Hotlink protection is currently enabled enabled是启用防盗链 disabled是禁用防盗链
Urls to Allow Access: 输入允许调用文件的域名,二级域名也需要输入
Extensions to allow (seperate by commas):设置后缀
Url to Redirect to: 设置转向URL
Allow direct requests (ie. entering the url to an image in your browser) 允许在浏览器中直接调用
点击Activate启用防盗链 点击Disable禁用防盗链
最后,防盗链就设置好了。