当前位置: 首页 > 图文教程 > 网络编程 > PHP > PHP技巧代码:apache 防盗链两例

PHP
PHP学习宝典-第四章
PHP学习宝典-第五章
PHP学习宝典-第六章
PHP学习宝典-第六章(续篇)
PHP学习宝典-第七章
PHP学习宝典-第八章(一)
PHP学习宝典-第八章(二)
PHP学习宝典-第九章
php配置,链接access数据库
HTML 初学者指南(一)
HTML 初学者指南(二)
HTML 初学者指南(三)
HTML 初学者指南(四)
HTML 初学者指南(五)
HTML 初学者指南(六)
HTML 初学者指南(七)
HTML 初学者指南(八)
HTML 初学者指南(九)
HTML 初学者指南(十)
网页常用特效整理:初级篇

PHP技巧代码:apache 防盗链两例


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-28   浏览: 59 ::
收藏到网摘: n/a

核心提示:1.利用rewrite 确认你的apache 能使用rewrite mod RewriteEngine on RewriteCond %{HTTP_REFERER} !^http://ruanchen.com/"#ff6600">1.利用rewrite 确认你的apache 能使用rewrite mod

RewriteEngine on
  RewriteCond %{HTTP_REFERER} !^http://ruanchen.com/"#ff6600">2.利用SetEnvIfNoCase 和 access

SetEnvIfNoCase Referer "^http://ruanchen.com" local_ref=1
    SetEnvIfNoCase Referer "^http://www.ruanchen.com" local_ref=1
    <FilesMatch "\.(gif|jpb|png|css|js|swf)">
        Order Allow,Deny
        Allow from env=local_ref
    </FilesMatch>

红色为信任站点,蓝色为受保护的文件扩展名。