SEO Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   SEO Chat ForumsOtherSEO Scripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread SEO Chat Forums Sponsor:
  #1  
Old December 28th, 2007, 01:29 PM
MrMiguel MrMiguel is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 63 MrMiguel User rank is Private First Class (20 - 50 Reputation Level)MrMiguel User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 10 h 40 m 3 sec
Reputation Power: 2
Preventing hotlinking

Is there a way to prevent other websites from hotlinking to images on your server (i.e.: stealing bandwith), without causing (some) visitors of having problems visiting your website.

I already found the code below, but the disadvantage of this code is that your specifically have to specify what website you want to prevent from hotlinking (so I would preferably use another code that prevents any website from hotlinking.)

Code:
RewriteCond %{REQUEST_FILENAME} .*jpg$|.*gif$|.*png$ [NC]
RewriteCond %{HTTP_REFERER} !^$ 
RewriteCond %{HTTP_REFERER} !yoursite\.com [NC] 
RewriteCond %{HTTP_REFERER} !friendlysite\.com [NC] 
RewriteCond %{HTTP_REFERER} !google\. [NC] 
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]

RewriteRule (.*) /showpic.php?pic=$1

Now one question about this code;
I remember to have read somewhere that some antivirus software or firewalls, among which Norton, prevent the visitor from passing through 'HTTP_REFERER', with as result that visitors using that software cannot access your website at all anymore. Is this true, and if so, is there a way to 'prevent' this?

Thanks!

Reply With Quote
  #2  
Old December 29th, 2007, 09:29 PM
ClickyB's Avatar
ClickyB ClickyB is offline
Scru u guys I'm goin home
SEO Chat Expert (3500 - 3999 posts)
 
Join Date: Mar 2004
Location: Gloucester (South West UK).
Posts: 3,921 ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Months 4 Days 13 h 39 m 38 sec
Reputation Power: 50
This is similar to the script I use to prevent access.

You're not specifying the domains to deny from access, you're specifying domains to allow access (basically yours plus google/yahoo images etc if you want them), so it's easy enough...

Here's my version (in full):
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://mydomain.com:80/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.images.google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.images.search.yahoo.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://images.search.yahoo.com/.*$ [NC]
RewriteRule /* http://www.mydomain.com/ 403.php [R,L]


I put all my image files in one folder and install it there, so only (my own) server requests hit my image files (plus G&Y images bots); I've never had a problem with antivirus prog's preventing user access.
__________________
ClickyB
"The quality of the visitor is more important than the volume".. Egol 22nd Feb 2008
New to SEO? Start Here: SEO FAQ
Forum Rules & Posting Guidelines

Reply With Quote
  #3  
Old December 30th, 2007, 03:42 AM
MrMiguel MrMiguel is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 63 MrMiguel User rank is Private First Class (20 - 50 Reputation Level)MrMiguel User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 10 h 40 m 3 sec
Reputation Power: 2
Man that's a cool solution!

So I just put the above code in a .htaccess file which I place in my image folder?

Why would I actually not want to put that .htaccess file in the main folder of my website?

Reply With Quote
  #4  
Old January 3rd, 2008, 10:40 PM
ClickyB's Avatar
ClickyB ClickyB is offline
Scru u guys I'm goin home
SEO Chat Expert (3500 - 3999 posts)
 
Join Date: Mar 2004
Location: Gloucester (South West UK).
Posts: 3,921 ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Months 4 Days 13 h 39 m 38 sec
Reputation Power: 50
Quote:
Originally Posted by MrMiguel
Man that's a cool solution!

So I just put the above code in a .htaccess file which I place in my image folder?

Why would I actually not want to put that .htaccess file in the main folder of my website?
Because this blocks access to every file type so weblinks would also redirect to your 403 page

If you want to put in in your root .htaccess and specify image file types (like your example) you need to make sure that any new image types are added to the rule and if you vary your filename case you need to cover that too...

I just find this way much less complicated.

Reply With Quote
  #5  
Old January 3rd, 2008, 11:06 PM
EGOL's Avatar
EGOL EGOL is offline
EGOL
Click here for more information.
 
Join Date: Jun 2003
Location: Snow belt.
Posts: 6,671 EGOL User rank is Second Lieutenant (5000 - 10000 Reputation Level)EGOL User rank is Second Lieutenant (5000 - 10000 Reputation Level)EGOL User rank is Second Lieutenant (5000 - 10000 Reputation Level)EGOL User rank is Second Lieutenant (5000 - 10000 Reputation Level)EGOL User rank is Second Lieutenant (5000 - 10000 Reputation Level)EGOL User rank is Second Lieutenant (5000 - 10000 Reputation Level)EGOL User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 4 Days 4 h 34 m 47 sec
Reputation Power: 71
Some guy selling on ebay was hotlinking my images.... lots of them for an item that he had dozens of listings running continuously. I emailed him and he told me to F.. off...

So I waited until he had a ton of bids on these items and then switched my image to a text .gif that said..

PARTS MISSING - SOLD "AS IS"

He quit hotlinking.
Comments on this post
ClickyB agrees:
__________________
* Its not the size of the dog in the fight that matters... it's the size of the fight in the dog.
* Free advice generally isn't worth much, but cheap advice is worth even less.

Reply With Quote
  #6  
Old January 4th, 2008, 10:57 AM
MrMiguel MrMiguel is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 63 MrMiguel User rank is Private First Class (20 - 50 Reputation Level)MrMiguel User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 10 h 40 m 3 sec
Reputation Power: 2
Ok, but now let's get back a little to the essence of my question; ;)

Do you think having other websites hotlinking (some of) your images is good for your SERPS because Google sees it as votes for your content, similarly as inbound text links? Or in other words, is preventing hotlinking bad for your rankings??

Thanks for your thoughts!

Reply With Quote
  #7  
Old January 4th, 2008, 11:01 AM
ClickyB's Avatar
ClickyB ClickyB is offline
Scru u guys I'm goin home
SEO Chat Expert (3500 - 3999 posts)
 
Join Date: Mar 2004
Location: Gloucester (South West UK).
Posts: 3,921 ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level)ClickyB User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Months 4 Days 13 h 39 m 38 sec
Reputation Power: 50
Quote:
Originally Posted by MrMiguel
Do you think having other websites hotlinking (some of) your images is good for your SERPS because Google sees it as votes for your content, similarly as inbound text links? Or in other words, is preventing hotlinking bad for your rankings??

Thanks for your thoughts!
Hotlinking an image is only adding a vote for the image file... might help your ranking for the image in Google images but I doubt it'll do anything else.
Personally I don't want anyone stealing my BW, I'd rather get my votes from links.

Reply With Quote
Reply

Viewing: SEO Chat ForumsOtherSEO Scripts > Preventing hotlinking


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT