Adam Howard
Well-known member
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)
I know someone here must have done this before.
Can anyone here tell me what is wrong with this code?
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)
Rich (BB code):
# 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]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?allowedsite\.com [NC]
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]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?allowedsite\.com [NC]
RewriteRule ^attachments/.+$ http://www.yoursite.com/nohotlinking.jpg? [NC,L]
I know someone here must have done this before.
Can anyone here tell me what is wrong with this code?