Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

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 Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 5th, 2001, 10:20 PM
robotnix robotnix is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: aaaaaa
Posts: 26 robotnix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 12 sec
Reputation Power: 0
protect a directory BUT...

Hi ppl
I'm wondering if with Apache it is possible to
protect the content of a directory IF the referer is the domain itself and refuse access if let's say someone type it in the browser...

ex:
http://www.mysite.com/members/myfile.html

myfile.html calls a file let's say download.zip
this should work but if someone types directly
http://www.mysite.com/members/download.zip, this should now work because the referer is thae page before... so it gives access refused...

actually the idea behind all this is to refuse access to "web sucking" applications such as 'wget' in linux. yes I know I can use robots.txt but I don't want to in case a home made application ignores the robots.txt file.

thanks in advance.

Reply With Quote
  #2  
Old September 6th, 2001, 01:54 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
There are many ways to restrict access based on HTTP_REFERER. Start here -> http://forums.devshed.com/showthread.php?threadid=8952

Don't forget, HTTP_REFERER can be easily spoofed.

Reply With Quote
  #3  
Old September 13th, 2001, 06:45 PM
IceMan IceMan is offline
Roving Icicle
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Netizen
Posts: 56 IceMan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to IceMan Send a message via AIM to IceMan Send a message via Yahoo to IceMan
The best way to do this is to have the referering page be a script that sets a unique, time sensitive, identification value based on the ip of the client.

Simple way to do this in something like PHP, make a mysql table, ie "dl_auth", with fields for ip, timestamp, authcode. Then when you query the download, check the value against the ip and time. Also have the script check for an "old" timestamp on execution and remove it from the table.

Not a .htaccess solution, but it should work.
__________________
Is it just me or is it cold in here?

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > protect a directory BUT...


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 5 hosted by Hostway