Results 1 to 10 of 10
Thread: Hotlink Prevention!
-
03-18-2004, 10:26 PM #1Newbie
- Join Date
- May 2003
- Posts
- 27
Hotlink Prevention!
Hello! I have a bit of a problem that I am sure is heard rather often.. but here's my problem!
Well, I have an image gallery site and hotlinking is a major big problem for me. I ask people not to do it on every single page, yet some opt to do otherwise.
I've tried using the .htaccess file and I've changed every dang parameter possible, and well, what happens is that it won't let me hotlink to my own images.
It's like this. The webpage is in one directory, and the images are in another, and whenever I use the .htaccess file, the images I'm trying to display on my own page won't come up.
It's like this: http://www.site.com/site/folder/page.php
On this page, I'm trying to access the images from here:
http://www.site.com/site/folder/subfolder
I've tried several versions of the .htaccess file, and it won't let the images come up on my site when I use it!
Does anyone know the exact code I can use to prevent people from hotlinking to my images, but still allowing me to hotlink mine?
Thank you very much for your help! *Bowbow*
-
03-19-2004, 08:50 AM #2Newbie
- Join Date
- May 2003
- Posts
- 27
....please? *Sad*
-
03-19-2004, 05:12 PM #3Junior Guru Wannabe
- Join Date
- Jan 2004
- Posts
- 67
did you mean you have your images in folder:
yourdomain.com/images/
and you are trying to display images on webpages that are in:
yourdomain.com/dir/subdir/page.html?
-
03-19-2004, 06:18 PM #4Web Hosting Master
- Join Date
- Jan 2003
- Location
- Houston, TX - Originally from UK
- Posts
- 707
Rose, try this:
Code:RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC] RewriteRule .*\.(gif|jpg|jpeg|bmp|png)$ - [F,NC]
That should work, as all it does is stop hotlinking from domains other than yours
-
03-19-2004, 07:44 PM #5Junior Guru
- Join Date
- Jul 2002
- Location
- Detroit
- Posts
- 186
there's a built in hotlink protection in Cpanel if you have it. it allows you to specify certain domains that are allowed to hotlink
-
03-19-2004, 10:42 PM #6Web Hosting Master
- Join Date
- Sep 2002
- Location
- London/Edinburgh
- Posts
- 1,131
If you dont have cPanel try:
http://www.hotscripts.com/PHP/Script...ams/index.html
Might find something to help you there.
Regards
Thomas Currie█ Europhase UK Limited - XEN/OpenVZ UK/US Virtual Private Servers | R1Soft Backups for Web Hosts
█ Custom R1Soft Backups | UK/US Web Hosting | UK/US Virtual Private Servers
█ 99.9% Uptime SLA | Non Overloaded Service | Guaranteed Ram / Resources
█ Company: SC345142 VAT: GB-947754180 Tel: 0870 4710 895
-
03-21-2004, 09:15 AM #7Junior Guru
- Join Date
- Apr 2002
- Location
- Southern Maryland
- Posts
- 246
I have a tutorial here for hotlinking...if all else fails.
-
03-25-2004, 03:41 PM #8Junior Guru Wannabe
- Join Date
- Mar 2004
- Posts
- 82
I had that problem too. I use the hotlink protection on Cpanel and sometimes I replace the hotlinked image with one that says "guilty of hotlinking"...
-
03-28-2004, 11:01 PM #9Web Hosting Evangelist
- Join Date
- Jan 2004
- Location
- Washington, DC
- Posts
- 450
ModRewrite is a very, very useful tool!
Christian Dawson Exectuive Director and Co-Founder, i2Coalition
The i2Coalition is comprised of small to medium cloud providers, data centers, registrars, registries and other foundational Internet enterprises. Join today!
Follow us on Twitter @i2coalition or checkout our forum!
-
03-29-2004, 02:56 AM #10Web Hosting Evangelist
- Join Date
- Jul 2003
- Posts
- 533
i belive if some one like me running Norton internet security will be blocked from your images because Norton stops your server from seeing my refer or am i wrong ? because i tried this with some client site.
any comments ?