分类: 系统运维
2009-12-05 21:49:34
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
#RewriteCond %{REQUEST_URI} !^/t/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http.*://gonline\.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http.*://(.)+\. gonline\.com/.*$ [NC]
#RewriteCond %{HTTP_REFERER} !google\.com [NC]
RewriteRule .*\.(jpg|gif|png|bmp)$ http://file1.gonline.com/images/include/logo.png [L,NC]
配置说明:
RewriteEngine On:打开rewrite功能
RewriteCond %{HTTP_REFERER} !^$:判断请求来源HTTP_REFERER
RewriteCond %{REQUEST_URI} !^/t/.*$ [NC]:判断请求内容位置REQUEST_URI是否为/t/,/t/下的文件允许访问
RewriteCond %{HTTP_REFERER} !^http.*://gonline\.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http.*://(.)+\. gonline\.com/.*$ [NC]:允许域名及其子域名访问,同时包括http和https
RewriteRule .*\.(jpg|gif|png|bmp)$ http://file1.gonline.com/images/include/logo.png [L,NC]:将反盗链的图片转到http://file1.gonline.com/images/include/logo.png
R表示转接、L表示终止匹配,结束返回、NC不区分大小写