Forum Moderators: phranque

Message Too Old, No Replies

Help with blocking direct linking of my images

newbie and I need some pointers,please.

         

kindred1

6:23 pm on Nov 11, 2002 (gmt 0)

10+ Year Member



I have been getting ALOT of bandwidth theft from forums and other webpages direct linking to my images.I have searched and read alot of posts on this forum about the options I have.But im still a bit confused.

I want ALL of my images to be blocked from other sites.I am thinking of attemping the Htaccess script to help stop theives.

I have been just renaming images,but that has become too much work.been taking 2 hours a day to stop the leachers.

Any links on a simple tutorial on how to go about installing the htaccess file? Since I want all images blocked,do I put the file in my top directory?

Any other help or links would be great.Im very confused on where to start...,im sure my host allows me to do this(ipowerweb).

thanks.

oilman

12:12 am on Nov 12, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't know if your host supports htaccess but I think they do after having a poke around their site. Here's something you can try:

1) Open a text editor
2) Cut and paste:
RewriteCond %{HTTP_REFERER}!^http://yoursite.com/ [NC]
RewriteCond %{HTTP_REFERER}!^http://www.yoursite.com/ [NC]
RewriteRule [^/]+.(gif¦jpg)$ - [F]
3) change yoursite.com as appropriate
4) save as .htaccess
5) upload to your images folder
6) check your site and make sure it still works :)

kindred1

12:39 am on Nov 12, 2002 (gmt 0)

10+ Year Member



well,I ve been on this site all day researching.I called the host tech support,and they said that mod_rewrite is available

so I added that htaccess to my images directory,and it doesnt work..

called back and got a new tech,and he said his sup said it wasnt available at this time,but they sounded like they didnt know what it was exactly...

I want to call them again later,what exactly do I need to ask for...so they will understand..Im not sure how to word my question..
thanks.

quiet_man

12:41 am on Nov 12, 2002 (gmt 0)

10+ Year Member



Hi Kindred
I had a similar problem with people deeplinking to images on my site and using them as tags in free forums - everytime they posted my bandwidth was hit.
I replaced a few images with angry messages, then some blatant political adverts. Also I contacted the forum webmasters and pointed out their TOS and also the fact that they - the publisher - was legally responsible for the bandwidth theft. It worked in the end.
Alternatively there are a couple of threads that discuss this issue:

[webmasterworld.com...] - simple tips to stop image thieves

[webmasterworld.com...] - some tech advice on htaccess

Good luck.

oilman

12:42 am on Nov 12, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It might be best to just point them at this thread - any tech worth his paycheck should be able to read this and know exactly what it means.

kindred1

12:50 am on Nov 12, 2002 (gmt 0)

10+ Year Member



thanks for helping guys,
what should i email to them that would help them understand what exactly im looking for?
can anyone point out a link to send my host to..

kindred1

4:20 am on Nov 12, 2002 (gmt 0)

10+ Year Member



ok,I found out about phpinfo,and its ability to check my host.

this is what came up for loaded modules.

Loaded Modules mod_log_bytes, mod_bwlimited, mod_php4, mod_frontpage, mod_ssl, mod_setenvif, mod_so, mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core

so it looks like its installed,but why doesnt my htaccess changes work?is there something else i can do?

is there more info on my phpinfo.php page i need to look at to find out?

thanks.

jdMorgan

5:07 am on Nov 12, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Turn on the rewrite engine, plus a few tweaks to the code:

1) Open a text editor
2) Cut and paste:


Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^http://(www\.)?yoursite\.com [NC]
RewriteRule \.(gif¦jpeg?¦jpg)$ - [F]

3) replace "yoursite\.com" with your real domain name and precede any "." with a "\" as shown
4) save as .htaccess
5) upload to your images folder (or top-level folder)
6) check your site and make sure it still works

Note that the forum software eats the space character preceding the "!" in the RewriteCond, and often modifies the "¦" character as well.

HTH,
Jim

jdMorgan

5:40 am on Nov 12, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



kindred1,

Once you get that working, you may wish to experiment with this version. It allows for visitors whose browsers or proxy caches do not provide a referrer, and also allows various search engine caches and translation utilities to properly display your images.

Because of the number of people on the 'net whose ISP's use caching proxies, it's a good idea to allow a blank referrer, although this is an imperfect solution.

Allowing the search engine caches and translators to display your images is completely optional, depending on your market. However, I suggest allowing all of them unless you have a really good reason not to. Otherwise, your site will appear broken to anyone using them.


Options +FollowSymlinks
RewriteEngine on
# Block image inclusion outside our domain except Google, AltaVista, Gigablast, Comet Systems, and SearchHippo translators and caches
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain\.com [NC]
RewriteCond %{HTTP_REFERER} !^http://216\.239\.(3[2-9]¦[45][0-9]¦6[0-3]).*(www\.)?yourdomain\.com [NC]
RewriteCond %{HTTP_REFERER} !^http://babel.altavista.com/.*(www\.)?yourdomain\.com [NC]
RewriteCond %{HTTP_REFERER} !^http://216\.243\.113\.1/cgi/
RewriteCond %{HTTP_REFERER} !^http://search.*\.cometsystems\.com/search.*(www\.)?yourdomain\.com [NC]
RewriteCond %{HTTP_REFERER} !^http://.*searchhippo\.com.*(www\.)?yourdomain\.com [NC]
RewriteRule \.(gif¦jpg¦jpeg?)$ - [NC,F]

Jim

kindred1

5:17 pm on Nov 12, 2002 (gmt 0)

10+ Year Member



thanks alot,I just got an email from tech support apologizing for the mix up.

"Yes, you can use .htaccess files on our servers. You can use the file manager to create and edit .htaccess files.."

so it looks like I have to go through my cpanel to do this,im gonna give that a shot.Is having to go through my cpanel normal?

I definately want to allow search engines to cache my page..so im gonna do some more searching in the forums.

thanks to everyone for the help,you guys are wonderful...

jdMorgan

9:19 pm on Nov 12, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is having to go through my cpanel normal?

Maybe it is, for your hosting service. But it would be a lot easier if you could just use FTP to upload the file. If that's not an option, you'll have to work with what you've got.

Jim

kindred1

9:37 pm on Nov 12, 2002 (gmt 0)

10+ Year Member



thanks,im about to attemp it in a few minutes....im going to put your second post to work first.

Options +FollowSymlinks
RewriteEngine on
# Block image inclusion outside our domain except Google, AltaVista, Gigablast, Comet Systems, and SearchHippo translators and caches
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?yourdomain\.com [NC]
RewriteCond %{HTTP_REFERER}!^http://216\.239\.(3[2-9]¦[45][0-9]¦6[0-3]).*(www\.)?yourdomain\.com [NC]
RewriteCond %{HTTP_REFERER}!^http://babel.altavista.com/.*(www\.)?yourdomain\.com [NC]
RewriteCond %{HTTP_REFERER}!^http://216\.243\.113\.1/cgi/
RewriteCond %{HTTP_REFERER}!^http://search.*\.cometsystems\.com/search.*(www\.)?yourdomain\.com [NC]
RewriteCond %{HTTP_REFERER}!^http://.*searchhippo\.com.*(www\.)?yourdomain\.com [NC]
RewriteRule \.(gif¦jpg¦jpeg?)$ - [NC,F]

also,what do I add to the code to redirect to a picture with my domain name advertisement for hotlinkers..

thanks alot,awesome help!

Hard_Drive

12:23 pm on Dec 25, 2002 (gmt 0)

10+ Year Member



Replace The last line in that .htaccess with this

RewriteRule .*[Jj][Pp][Gg]$¦.*[Gg][Ii][Ff]$ [yoursite.com...]

you can make the URL to an image or anything you want...

Good Luck!

Key_Master

3:50 pm on Dec 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



With regard to the advice about allowing image access to search engine caches and questionable redirects (frames, etc), I would suggest redirecting the visitor to the actual page instead.

By the way, I would add searchhippo.com to the ban list.

jdMorgan

4:17 pm on Dec 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



kindred1,

The following rules are variants you might want to try:


RewriteRule \.(gif¦jpg¦jpeg?)$ - [NC,F]
RewriteRule \.(gif¦jpg¦jpeg?)$ /extra_special.$1 [NC]
RewriteRule \.(gif¦jpg¦jpeg?)$ /hotlinker.html [NC]

The first one simply returns a 403-Forbidden server response - no content is returned.
The second one returns an "extra-special" image file of type .gif, .jpg, .jpe, or .jpeg, as appropriate.
The third variant redirects all requests to an html file - /hotlinker.html.

It is not necessary to provide a method and domain name (http://yourdomain.tld) in the target URI, unless you wish to redirect off-site. If that is the case, then you must use [NC,R] or [NC,R=301] as the flags at the end of the rule.

As to whether you want to stop Google and AV translators, and SearchHippo from displaying your images, that is a marketing question for some, and a privacy issue for others.

Jim

Birdman

5:45 pm on Dec 25, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is having to go through my cpanel normal?

I have to use the file manager on my cpanel also. .htaccess will not upload through via my ftp program. So, you're not alone there. Good luck!