DeveloperSide.NET Forums
December 13, 2019, 12:29:57 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Determining a referrer for directory access  (Read 6220 times)
0 Members and 1 Guest are viewing this topic.
Fenwick
Jr. Member
**
Posts: 50


View Profile
« on: September 30, 2005, 09:46:54 AM »

with the use of a .htaccess file in a directory can one specify the exact referrer that gets access, while denying any and all other referrers?


Code:

<Directory />
  Order deny, allow
  Deny from all
  Allow from .domain.com/subdirectory/subdirectory/file.ext
</Directory>


The idea being that only a link from a specific predetermined place within the above sample directive allow access to that directory.

Any advice on the possibility of maybe establishing a "forward" link for all those denied?  In place of an error messge or even a page explaining why the denial other then a default browser error?

Thanks in advance for any input .....
Logged

magination is the Only Limitation

Phantasia a community based forum on security and additional help with server software. Site is beta-mode - and will start filling forums with additional help as soon as possible
 
http://myphantasia.cjb.net/
Jorge
Customer, Basic Support
Guru
*****
Posts: 544

jorge_schrauwen@msn.com
View Profile WWW
« Reply #1 on: September 30, 2005, 01:15:13 PM »

I think mod_rewrite would be better in such a case. I Think it can't be done with just access directives
Logged

Demoric
Jr. Member
**
Posts: 34

64788622 jaydiumsoftware
View Profile WWW
« Reply #2 on: October 06, 2005, 01:55:31 AM »

To my knowledge you can only use just the sitename or IP for that.

E.G.
Allow from SuperFantasticSite.com
Allow From 182.468.128.168

I use something like this:
Code:

#---------- Prevent Bandwidth Thieves by Folder -----------
SetEnvIf REFERER "yoursite\.no-ip\.com" linked_from_here
SetEnvIf REFERER "^$" linked_from_here

<Directory C:/apache2triad/protectedfolder>
    Order deny,allow
    Deny from all
    Allow from env=linked_from_here
</Directory>
## ---------------------------------------------------------
Logged

ttp://jaydium.servehttp.com
http://jaydium.selfhost.com
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!