How to protect your photos from hotlinking - A Primer
This post is meant as a tutorial and it will come in "chapters".
So there is no public reply function. You are free to discuss this in other postings, but treat this as a tutorial...
And also: I collected these informations and they work for me with different accounts, but I cannot guarantee that everything will work for everybody!
A photoblog is aimed to show your photos.
You want to present your photos in the context which you create / design / layout.
You do not want to find your photos at other websites, in some blogs or community-portals ..
Well, I noticed some phenomen in the last time regarding my photos at photografitti.net and the server-load there increased:
increasing hits at photografitti.net, but not so many hits to index.php
what was going on?
I did a websearch and found out, that many of my images were "hotlinked" from other sites.
I checked these sites and found that some of my photos sat in very disgusting, obscene or stupid teeny-postings and other blablabla-pages
these people just entered the URL of my photos when they added images to their blog-posts
but how did they find my photos? I never saw these people in my stats..
the answer was: they found my images at images.google.com and just copied the URL there, they never visited my site..
What to do?
There are different steps to prevent hotlinking.
I will describe them in the following posts. Step by Step.
#I How to prevent hotlinking with .htaccess
Wikipedia describes hotlinking the following:
Check whether your webhoster offers you the chance to stop hotlinking.
If your webspace sits on an apache server, the chance to stop hotlinking is very good.
If you use CPANEL, you will use the option Hotlink Protection
If you do not find it at first glance, look for the advanced menu.
In that section first you will find a description of Hotlinks and a form to define your rules.
Example: All direct accesses to files with the extension .jpg from the domain myimages.com will be served with the respective file, all other accesses from other domains will be directed to another URL, for example to another image-file.
So you name myimages.com in the list of allowed URLs, the extensions gif,jpg,GIF,JPG in the allowed extensions and the URL for the redirect.
As a result, you will get a .htaccess-file in the root of your server whith rules like these:
All accesses to your photo-files from the domain myimages.com will be served correctly, the browser will show these files.
All other accesses, for example a link in a html-file or a forum at www.thisisnotmydomain.com will be redirected to the file donothotlink.jpg at your domain.
The .htaccess-file at www.photografitti.net allows access from a list of domains, all other accesses will be redirected to this file:
This JPG-file tells in german, that the intended image, which should show off here, is stolen from my website www.photografitti.de
here is an excerpt from that .htaccess-file:
People, who steal your photos will be blamed.
They will learn something from that, I hope.
But still your webserver will deliver a graphic file and these hotlinking people will steal your traffic. But they are not stealing your photos anymore!
Remember, that this is only working with APACHE, not with IE-Servers!
#2 how to prevent crawling your website using robots.txt
The robots exclusion standard or robots.txt protocol is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a website which is, otherwise, publicly viewable.
This part is not a complete introduction to the use and benefit of the file robots.txt which is a good tool to control bots and spiders (beside other purposes), it is a short introduction and lists usefull directives.
You can set different directives in that file, which must be placed in the root of your website (edit it with an ASCII-editor and upload it in ASCII-modus to your webspace)
As it would make no sense to block your website for all bots, indexing robots and search machines, it does make sense to block some of them explicitely
To stop Microsoft Search (Windows Live) to crawl your site completley, you can add this:
#3 how to control Bots with Meta-Tags
last but not least, these tags
Mother Wikipedia says: Meta elements are HTML elements used to provide structured metadata about a web page. Such elements are placed as tags in the head section of an HTML document.
They are helpful to stop robots and crawlers, at least the good behaving ones, as they are part of Web-Standard.
For Pixelpost, Meta-Tags must be placed in the head section of the templates which you activated in the admin section.
The head-section of, f.e., the simple-template comes like this:
Microsoft itself recomments to use this tag to stop indexing of Image-Files and Media-Files (I did not find a specification which mediafiles they will stop to index...)
add these lines to the head-sections of image_template.html, about_template.html, browse_template.html, comment_template.html .. to all your template-files in your template-folder
this was the third and last part of the small tutorial, when I find time (after adding all this code to all my .htaccess, robots.txt and template-files :rolleyes: ), I will add this to the Pixelpost Wiki as well
nice writup connie! im sure some users will find this useful.
we need to get a pixelpost blog up for content link this. that can be next weekends chore for me. this one is booked up.
We are waiting for new such nice texts Connie. Really nice work ;)
I will try, whatever will annoy me next...
I will add this to the wiki as well
|All times are GMT. The time now is 02:35 AM.|
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.