replace image in post with another

Member 3639

Active member
So i have found a website nicking my images and hotlinking directly to it and then poaching my news.

In my post i have an image attached, where do i find this image so i can replace it with a little message for them? I tried the attachments folder but the image for it in there is tiny :S

Ps. Is there a way to stop people being able to hot link attached files?
 
You can disable hotlinking at the server level.

If you have cPanel you can do it from there.

Or you can add something like this to your .htaccess file:
Code:
# Prohibits hotlinking of images
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://mysite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http:// mysite .com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com$ [NC]
RewriteRule .*\.(jpeg|gif|bmp|png|jpg)$ path/to/replacement/image.png [L]

The full size images are in the internal_data directory.
 
I couldn't get it to work in cpanel so i sent a support ticket.

Managed to find where they attachments are stored so i re-made a nicer image for them.

That will teach them.
 
Try this:

Code:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://gamingonlinux.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://gamingonlinux.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.gamingonlinux.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.gamingonlinux.com$ [NC]
RewriteCond %{QUERY_STRING} attachments/.*$
RewriteRule ^.*$ http://www.gamingonlinux.com/nohotlinking.jpg? [NC,L]
 
I know this part works:

Code:
RewriteEngine On
RewriteCond %{QUERY_STRING} attachments/.*$
RewriteRule ^.*$ http://www.gamingonlinux.com/nohotlinking.jpg? [NC,L]

I didn't actually test the referral stuff.
 
Top Bottom