President-Anonymous Posted August 30, 2012 Report Posted August 30, 2012 I've hit a wall.... The Goal Block site X and show them image X Blocked site Y and show them image Y Block everyone else and show them image Z Have a safe list / white list, so that I can still hot link here on XenForo and a few other select sites. What Jake came up with (but doesn't seem to work) # NO HOTLINK FOR SITE X RewriteCond %{HTTP_REFERER} ^http://(www\.)?sitex\.com [NC] RewriteCond %{REQUEST_URI} !nohotlinkingx\.jpg$ [NC] RewriteRule \.(jpg|gif|jpeg|png|bmp|pdf|zip|txt|svg)$ http://www.yoursite.com/nohotlinkingx.jpg? [NC,L] RewriteCond %{HTTP_REFERER} ^http://(www\.)?sitex\.com [NC] RewriteRule ^attachments/.+$ http://www.yoursite.com/nohotlinkingx.jpg? [NC,L] # NO HOTLINK FOR SITE Y RewriteCond %{HTTP_REFERER} ^http://(www\.)?sitey\.com [NC] RewriteCond %{REQUEST_URI} !nohotlinkingy\.jpg$ [NC] RewriteRule \.(jpg|gif|jpeg|png|bmp|pdf|zip|txt|svg)$ http://www.yoursite.com/nohotlinkingy.jpg? [NC,L] RewriteCond %{HTTP_REFERER} ^http://(www\.)?sitey\.com [NC] RewriteRule ^attachments/.+$ http://www.yoursite.com/nohotlinkingy.jpg? [NC,L] # NO HOTLINK FOR ALL SITES RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?yoursite\.com [NC] [COLOR=red]RewriteCond %{HTTP_REFERER} !^http://(www\.)?allowedsite\.com [NC][/COLOR] RewriteCond %{REQUEST_URI} !nohotlinking\.jpg$ [NC] RewriteRule \.(jpg|gif|jpeg|png|bmp|pdf|zip|txt|svg)$ http://www.yoursite.com/nohotlinking.jpg? [NC,L] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?yoursite\.com [NC] [COLOR=red]RewriteCond %{HTTP_REFERER} !^http://(www\.)?allowedsite\.com [NC][/COLOR] RewriteRule ^attachments/.+$ http://www.yoursite.com/nohotlinking.jpg? [NC,L] [/code] I know someone here must have done this before. Can anyone here tell me what is wrong with this code? (If you don't have the answer... Please like this post knowing that I wasn't someone who opened up a wasteful support ticket. I imagine that happens a lot.) raixroorund, ligiomounsula, Orvilrvlipv and 13 others 16 Quote
President-Anonymous Posted August 30, 2012 Author Report Posted August 30, 2012 Well it's official. I don't know how to do a rich text code in ipb. so basic code will have to do # NO HOTLINK FOR SITE X RewriteCond %{HTTP_REFERER} ^http://(www\.)?sitex\.com [NC] RewriteCond %{REQUEST_URI} !nohotlinkingx\.jpg$ [NC] RewriteRule \.(jpg|gif|jpeg|png|bmp|pdf|zip|txt|svg)$ http://www.yoursite.com/nohotlinkingx.jpg? [NC,L] RewriteCond %{HTTP_REFERER} ^http://(www\.)?sitex\.com [NC] RewriteRule ^attachments/.+$ http://www.yoursite.com/nohotlinkingx.jpg? [NC,L] # NO HOTLINK FOR SITE Y RewriteCond %{HTTP_REFERER} ^http://(www\.)?sitey\.com [NC] RewriteCond %{REQUEST_URI} !nohotlinkingy\.jpg$ [NC] RewriteRule \.(jpg|gif|jpeg|png|bmp|pdf|zip|txt|svg)$ http://www.yoursite.com/nohotlinkingy.jpg? [NC,L] RewriteCond %{HTTP_REFERER} ^http://(www\.)?sitey\.com [NC] RewriteRule ^attachments/.+$ http://www.yoursite.com/nohotlinkingy.jpg? [NC,L] # NO HOTLINK FOR ALL SITES RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?yoursite\.com [NC] [COLOR=red]RewriteCond %{HTTP_REFERER} !^http://(www\.)?allowedsite\.com [NC][/COLOR] RewriteCond %{REQUEST_URI} !nohotlinking\.jpg$ [NC] RewriteRule \.(jpg|gif|jpeg|png|bmp|pdf|zip|txt|svg)$ http://www.yoursite.com/nohotlinking.jpg? [NC,L] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?yoursite\.com [NC] [COLOR=red]RewriteCond %{HTTP_REFERER} !^http://(www\.)?allowedsite\.com [NC][/COLOR] RewriteRule ^attachments/.+$ http://www.yoursite.com/nohotlinking.jpg? [NC,L] Quote
President-Anonymous Posted September 6, 2012 Author Report Posted September 6, 2012 Well.... Still not working..... Given up on using more than 1 photo and so I tried this... # hotlink protection allowing for multiple domains RewriteCond %{HTTP_REFERER} . RewriteCond %{HTTP_REFERER} !^http://([^.]+\.)?sociallyuncensored\. [NC] RewriteCond %{HTTP_REFERER} !search\?q=cache [NC] RewriteCond %{HTTP_REFERER} !google\. [NC] RewriteCond %{HTTP_REFERER} !bing\. [NC] RewriteCond %{HTTP_REFERER} !yahoo\. [NC] RewriteCond %{REQUEST_URI} !^/hotlink\.jpg$ [NC] RewriteRule \.(gif|jpg|png)$ http://www.sociallyuncensored.eu/hotlink.jpg [R,NC,L][/php] No luck. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.