Web: April 2007 Archives

超强的apache防盗链方法

| | Comments (0) | TrackBacks (0)

上周服务器重整,很多文件丢失了,真是郁闷。
因为站内有很多媒体文件,才一天不做防盗,流量就飙升了12G。看来不防不行了。
翻遍整个互联网终于找到了一个可行的办法,也是唯一有效的。

在网站根目录下放一个文件,文件名为 .htaccess
内容如下:

BrowserMatch "^RealPlayer" local_media=1
BrowserMatch "^MediaPlayer" local_media=1
BrowserMatch "^Windows-Media-Player" local_media=1
BrowserMatch "^NSPlayer" local_media=1
<FilesMatch "\.(wma|wmv|mp3|rm|asf)">
Order Deny,Allow
Deny from All
Allow from env=local_media
Allow from 127.0.0.1
</FilesMatch>

这样可以防止IE直接下载,而且只能在你站内的播放器收听哦,哇嘎嘎!

 

 

About this Archive

This page is a archive of entries in the Web category from April 2007.

Web: October 2007 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Web: April 2007: Monthly Archives

Powered by Movable Type 4.01