How Can I Stop Other Sites Hotlink My Images

Problems with the Windows version of XAMPP, questions, comments, and anything related.

How Can I Stop Other Sites Hotlink My Images

Postby Hoagsie » 01. July 2007 02:39

Hi Folks,

I Have Been Trying To Add The Rewrite Engine Rule To Stop Others From Hotlinking to My Images Folder, And Display A "Stop Holinking" Image Instead, But I Am Not Having Much Luck :(
Most Attempts I have Made, Have Stopped Me From Seeing My Own Files :( lol

Does Anyone Know How I Should Write Into The .htaccess File, The Lines That Will Do This ?
Where Do I Put The .htaccess File? In The Root Or In The images Folder?

My Site Is www.lethalintention.com

Any Help Would Be Greatly Appreciated.

Thank You, In Advance
Hoagsie
 
Posts: 13
Joined: 14. June 2007 22:30

Postby Wiedmann » 01. July 2007 10:00

Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Hoagsie » 01. July 2007 13:53

I Have Already Visited That Very Same Page & Although i have Read it Again, It Does Not Supply An Answer To This Particular Question :(

I Want To BLOCK Folks From Hotlinking To My Pics And Display
A "Stop Holinking" Image Instead


But Thank You For The Lnk :(

I Am Still Looking Around For A Script That Will Work, But The Only Ones i Find, Block ME From Seeing My Own Site :(.

I Have Virtual Hosts Also, Could This Be The Reason Why It Is Not Working For me?


This Is The Script I Am Adding To The .htaccess File in My Images Folder For That Particular Site

# direct requests to files in this directory not allowed
Options -Indexes

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?lethalintention.com/.*$ [NC]
RewriteRule .*.(gif|jpe?g|png)$ http://www.lethalintention.com/noop.jpg [R,NC,L]



But The Result I Get Is, Is To Only Block My Own Images ...ie , I Cannot See Them Either :(


Does Anyone See What I Am Doing Wrong?
Hoagsie
 
Posts: 13
Joined: 14. June 2007 22:30

Postby johnd » 01. July 2007 14:11

hi

try this

Code: Select all

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://yourdomain.com/.*$ [NC] [OR]
RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com/.*$ [NC] [OR]
#RewriteRule .*\.(gif|GIF|jpg|JPG|bmp|BMP|wav|mp3|wmv|avi|mpeg)$ - [F]



add the domain that can have access on new line

:D
johnd
 
Posts: 17
Joined: 27. June 2007 16:43

Postby Hoagsie » 01. July 2007 14:23

Hi Johnd

Nope, I Just Tried That Too .. lol.. My Apache Hates Me..lol.. It Blocks Me From Seeing Any Of My Images Also :(

I Even Tried

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://lethalintention.com/.*$ [NC] [OR]
RewriteCond %{HTTP_REFERER} !^http://www.lethalintention.com/.*$ [NC] [OR]
RewriteCond %{HTTP_REFERER} !^http://60.242.139.84/.*$ [NC] [OR]
#RewriteRule .*\.(gif|GIF|jpg|JPG|bmp|BMP|wav|mp3|wmv|avi|mpeg)$ - [F]



I Have Tried Adding It To The .htaccess in The Root As Well As The One i Have In The Images Folder ... Still With The Same Result :(
Hoagsie
 
Posts: 13
Joined: 14. June 2007 22:30

Postby Hoagsie » 01. July 2007 17:14

Ps...

Where Should i Be Placing this .htaccess File?

In My Public Folder...? In The Root Of The Site folder...? Or In The Images Folder?

:)

Sorry For Being Such a Noob :(
Hoagsie
 
Posts: 13
Joined: 14. June 2007 22:30

Postby Hoagsie » 02. July 2007 01:44

Further Note ***


It Seems That The htaccess Is Restricting Me From Hotlinking Within My Own Site...

ie - In My Forums, A Member Is Hotlinking His Avatar From The Images Folder.... When I Add The Rule To htaccess , This Image is Automatically Blocked Also...

I Have Presently Got The Following In My htaccess File Which i Have Located In My Images Folder

# direct requests to files in this directory not allowed
Options -Indexes

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://lethalintention.com/.*$ [NC] [OR]
RewriteCond %{HTTP_REFERER} !^http://www.lethalintention.com/.*$ [NC] [OR]
RewriteCond %{HTTP_REFERER} !^http://www.lethalintention.com/forums/.*$ [NC] [OR]
RewriteCond %{HTTP_REFERER} !^http://www.lethalintention.com/forums/uploads.*$ [NC] [OR]
RewriteCond %{HTTP_REFERER} !^http://www.lethalintention.com/images/.*$ [NC] [OR]
RewriteCond %{HTTP_REFERER} !^http://60.242.139.84/.*$ [NC] [OR]
RewriteCond %{HTTP_REFERER} !^http://192.168.1.1:80/.*$ [NC] [OR]
#RewriteRule .*\.(gif|GIF|jpg|JPG|bmp|BMP|wav|mp3|wmv|avi|mpeg)$ - [F]


I Only Want to Stop Others, Outside My Site, From Hotlinking... But Presently The Code Seems To Be Stopping ALL hotlinking, Even Within My Own Site..

I Run A Few domains Via A Public Folder (Vhosts)


Any Help Would be Greatly Appreciated... This is Driving Me Nutsoid :P lol
Hoagsie
 
Posts: 13
Joined: 14. June 2007 22:30

Postby Hoagsie » 02. July 2007 02:39

Hmmm

I Just Tested The Rewrite Mod With The Following

Options +FollowSymLinks
RewriteEngine On


I Get A Server 500 Error..

I Have Enabled The Rewrit mod In The httpd , But Obviously I May Be Missing Something...

Any Ideas?

I Thought Once Enabled & Restarted, The Rewrite Mod Would Be Present...
Do i Need to Install The Module Somehow/Somewhere?
Hoagsie
 
Posts: 13
Joined: 14. June 2007 22:30

Postby Hoagsie » 04. July 2007 12:45

Anyone? :(
Hoagsie
 
Posts: 13
Joined: 14. June 2007 22:30


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 45 guests