Home | Mirror | Search

3. 設置Apache實現防盜連

SetEnvIf Referer "http://news.netkiller.com/" local_referal
SetEnvIf Referer "$" local_referral

Order Deny,Allow
Deny from all
Allow from env=local_referal
		

配置httpd.conf檔案

#LoadModule rewrite_module modules/mod_rewrite.so

去掉前面的"#"註釋

AllowOverride None

改為

AllowOverride All

配置.htaccess檔案

RewriteEngine on
RewriteCond % !^http://xxx.cn/.*$    	[NC]
RewriteCond % !^http://xxx.cn$     		[NC]
RewriteCond % !^http://www.xxx.cn/.*$	[NC]
RewriteCond % !^http://www.xxx.cn$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|rar|zip|exe)$ http://download.example.com/err.html [R,NC]
		
comments powered by Disqus