GIDForums  

Go Back   GIDForums > Web Hosting Forums > Web Hosting Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 07-Mar-2003, 23:25
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough

Using mod_rewrite to prevent hotlinking and email harvesters


I saw this linked to on my new hosts forum, but I thought it was really good so I posted it here.

http://www.websiteowner.info/tutoria...widththeft.asp
This site explains what mod_rewrite can do and how to prevent hotlinking

A link on the above link went to here:
Blocking scumbag crawlers from your site . Its a bit old but I'm sure most of the same e-mail harvesting crawlers are still being used.
Try looking here for newer ones possibly:
http://simplythebest.net/info/userag...ollectors.html
and this is a good one too:
http://www.sendfakemail.com/fakemail/antispam.html

Hope you find this useful. I'm thinking of setting up the mod_rewrite on my new host for loads of reasons now.
  #2  
Old 01-May-2003, 10:50
Div's Avatar
Div Div is offline
Moderator
 
Join Date: May 2002
Posts: 996
Div has a spectacular aura aboutDiv has a spectacular aura about
I've been wanting to try this out for a while...it should save me a lot of bandwidth on some of my websites. Time to try it out.
__________________
Web Hosting Tips | Career Advice
  #3  
Old 01-May-2003, 10:53
Div's Avatar
Div Div is offline
Moderator
 
Join Date: May 2002
Posts: 996
Div has a spectacular aura aboutDiv has a spectacular aura about
Cool

Eureka....it works! And it took all of 30 seconds.
__________________
Web Hosting Tips | Career Advice
  #4  
Old 01-May-2003, 10:57
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
I'm having a bit of trouble with it maybe you can help me Div. I've successfully prevented the hotlinking, but I'm having an adversary affect on my site in that its forbidding me to download from on the site too.

This is the .htaccess file on one of my subfolders that I'm trying to protect:
Code:
Rewriteengine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://www.topfunwebsites.com/.*$ [NC] RewriteRule .*\.(zip|ZIP)$ - [F]


Any ideas?
  #5  
Old 01-May-2003, 11:06
Div's Avatar
Div Div is offline
Moderator
 
Join Date: May 2002
Posts: 996
Div has a spectacular aura aboutDiv has a spectacular aura about
I would put in both,

RewriteCond %{HTTP_REFERER} !^http://www.topfunwebsites.com/.*$ [NC]

and

RewriteCond %{HTTP_REFERER} !^http://topfunwebsites.com/.*$ [NC]
__________________
Web Hosting Tips | Career Advice
  #6  
Old 01-May-2003, 11:12
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
Yeah I originally tried that. Something funny going on and I can't work it out. If try sticking it in my main .htaccess file I can't even access my site. I'm a bit confused now.

Rob
The only page I want to allow people to download the zips from is:
http://www.topfunwebsites.com/mambo/...age&Sub Menu=

does that help in any way?
  #7  
Old 01-May-2003, 11:18
Div's Avatar
Div Div is offline
Moderator
 
Join Date: May 2002
Posts: 996
Div has a spectacular aura aboutDiv has a spectacular aura about
Setting the referer to your domain should allow people to download from the specified page, assuming that is where they see the links or are redirected to.

I remember when I first tried something like this, my site was inaccessible as well and I just gave up.

What did you use to create the .htaccess file? A text editor I am assuming. I used notepad, and renamed it to .htaccess when I uploaded it the the "root" directory of my site.

FWIW, I can access your site fine right now.
__________________
Web Hosting Tips | Career Advice
  #8  
Old 01-May-2003, 11:32
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
yeah I used notepad, I've had success with .htaccess in the past although I don't understand some of it.
Its currently not protected since I'm not trying to exclude my own users. I'm glad it works for you though. I can't remember where I saw it, but there's a rule you can make for images to display whatever image you want so it could be a form of self advertisement or just say that someone has stolen it.
  #9  
Old 02-May-2003, 08:17
Div's Avatar
Div Div is offline
Moderator
 
Join Date: May 2002
Posts: 996
Div has a spectacular aura aboutDiv has a spectacular aura about
Thanks for posting this Rob. I have seen alternate ways to protect from hotlinking as well, but this one seems to work the best.
__________________
Web Hosting Tips | Career Advice
  #10  
Old 02-May-2003, 08:31
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
I'm glad that it works for someone that's what we are here at GIDForums to help each other out aren't we

Peace out

Rob
p.s. what are the alternative methods you have tried?
 
 

Recent GIDBlogLast Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:36.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.