[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] http referer



> Ok...here is my question.
>
> I have a site and lets say it is www.abc.com/members and I want the
content
> of the /members directory only accessible from 3 other
sites...www.abc1.com,
> www.abc2.com and www.abc3.com
>
> What is the structure of the http-referer info and where do I put it, in a
> .htaccess file in abc.com/members or in the httpd.conf file and what is
the
> exact format?
>
> Thanks!


If I have this correct, you're looking to publish content
(www.abc.com/members) which is only available to viewers who are referred
from specific sites (www.abc1.com, www.abc2.com, & www.abc3.com)?

If so, there's a couple of ways to go about it that I can think of.  One way
would be to build a small PHP (or language of your choice) script which
checks the referer and displays content based upon the non/matching referer:

if $referer = abc1.com OR abc2.com OR abc3.com
    show_content()
else
    redirect_elsewhere()

Another option would be to make use of the Apache module mod_access_referer:
http://accessreferer.sourceforge.net/

This module would allow you to use a .htaccess file to allow/deny access
based on the referer (seems to be what you're looking for).  Your .htaccess,
using the module above, would look something like:

order_referer allow_referer,deny_referer
deny_referer from all
allow_referer from .abc1.com .abc2.com .abc3.com

Other than that, I don't believe there's anything already built into the
Raqs/Cubes to achieve the same result.

--
Brian Curtis