|
|
|
|
![]() ![]() |
Jul 22 2006, 11:43 PM
Post
#1
|
|
|
Newbie [Level 3] ![]() ![]() ![]() Group: Members Posts: 45 Joined: 16-July 06 Member No.: 26,699 |
Sometimes, some people link directly to images in your host. This people is robbering you bandwidth. To avoid this only have to write some code lines in your .htaccess file in your host root:
QUOTE RewriteEngine On RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://your-domain.com [NC] RewriteCond %{HTTP_REFERER} !^http://www.your-domain.com [NC] RewriteRule .*\.(gif|jpg|swf|png)$ - [NC,F] There is another thing you can do. You can also show an image you want instead linked images. So the people that has been robbering you bandwidth will take a surprise. Just ad this to code: QUOTE RewriteRule .*\.(gif|jpg)$ http://tu-dominio/name-image-substitution.gif [R,NC] I hope you enjoy this. |
|
|
|
Jul 22 2006, 11:59 PM
Post
#2
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 4,076 Joined: 24-July 05 From: Linix, DOS and Windows…the good, the bad and the ugly Member No.: 9,787 ![]() |
Here at the Trap17, once you are Hosted, you can also use the Hotlink Protection in the Cpanel to do this same thing.
Similar to the Tutorial, you specify the domain names which you allow to link to your Images. Nice Tutorial, though. Short and sweet. |
|
|
|
Jul 23 2006, 12:14 AM
Post
#3
|
|
|
Trap Double Mocha Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 2,228 Joined: 5-November 05 From: That one place over there... Member No.: 13,830 |
Ya that is always a good idea to keep people from robbing you of your bandwidth. I think if people want to view things they should go to your site to view them so you can maybe get a few more customers out of it or visitors atleast. I don't really have a reason to do this though at the moment but I like the idea.
|
|
|
|
Jul 23 2006, 02:39 AM
Post
#4
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 127 Joined: 10-July 06 Member No.: 26,374 |
this is the great tutorial .thanks a lot.
the one thing that I don't understand is this code QUOTE RewriteRule .*\.(gif|jpg)$ http://tu-dominio/name-image-substitution.gif [R,NC] Do I need to change the link in that code? If I have to change the link there.How can I change it. Anyway thanks for the great tutorial. |
|
|
|
Jul 23 2006, 07:04 AM
Post
#5
|
|
|
Moderator ![]() Group: [MODERATOR] Posts: 1,337 Joined: 26-December 04 From: Canada Member No.: 2,940 |
I don't like to restrict images to certain referals, since some people block referals or change the referal fields to "google.com" or something... which means pictures on your site will appear as whatever you don't want...
|
|
|
|
Jul 23 2006, 08:41 PM
Post
#6
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 193 Joined: 20-December 05 Member No.: 15,962 |
I don't like to restrict images to certain referals, since some people block referals or change the referal fields to "google.com" or something... which means pictures on your site will appear as whatever you don't want... If you have a good knowledge of .htaccess files and PHP, then you could probably make a message appear asking them to use their normal referer. |
|
|
|
Jul 23 2006, 09:22 PM
Post
#7
|
|
|
Member [Level 2] ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 80 Joined: 10-December 05 From: Texas Member No.: 15,538 |
I still find it as a neat little tool, especialy if your not hosting through Trap17. Thanks for the post.
|
|
|
|
Jul 24 2006, 04:08 AM
Post
#8
|
|
|
Newbie [Level 3] ![]() ![]() ![]() Group: Members Posts: 45 Joined: 16-July 06 Member No.: 26,699 |
Thank you jlhaslip, i didn't know that feature. Really, I have never had to use these tricks, but it's a good idea to keep people from robbing you of your bandwidth.
Usually, people who do this are people who begin blogging and who don't know that they are making something bad. Ok, the code would have to be: CODE RewriteRule .*\.(gif|jpg)$ http://your-domain/name-of-substitute-image.gif [R,NC] or maybe just: CODE RewriteRule .*\.(gif|jpg)$ http://your-domain/image.gif [R,NC] |
|
|
|
Jul 24 2006, 08:34 AM
Post
#9
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 19 Joined: 24-July 06 Member No.: 27,176 |
.htaccess method works great if you do not have cPanel or any other similar app where you can manage hotlinking protection.
|
|
|
|