知乎专栏 |
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]