Is it possible to only allow sites to be accessed from certain sites?

Discussion in 'Community Forum Software' started by Abomination, Feb 1, 2010.

  1. Abomination

    Abomination Zealot

    Joined:
    Jun 1, 2009
    Messages:
    1,514
    Likes Received:
    102
    Would it be possible to set up a web page so that it could only be accessed when coming from a specific site.

    Example:
    RandomWebPage.com could only be access when coming from adminaddict.net.

    ?

    Or could a cookie be set indicating that RandomWebPage.com was accessed from adminaddict.net?



    As always feel free to move this Nick : )
     
  2. MjrNuT

    MjrNuT Grand Master

    Joined:
    Oct 14, 2009
    Messages:
    579
    Likes Received:
    36
    I believe this is done via .htaccess file such as the following:

    Code:
    # Allow from the website
    rewritecond %{HTTP_REFERER} "^http://(www)?\.mydomain\.com/.+$"
    RewriteRule ^(.*)$ $1 [L]
     
    2 people like this.
  3. Abomination

    Abomination Zealot

    Joined:
    Jun 1, 2009
    Messages:
    1,514
    Likes Received:
    102
    Thanks!

    I know nothing about .htaccess files, could that be put in a subdirectory or subdomain?

    adminaddict.net/SpecialPage or SpecialPage.adminaddict.net?

    But access to adminaddict.net would not be affected?
     
  4. MjrNuT

    MjrNuT Grand Master

    Joined:
    Oct 14, 2009
    Messages:
    579
    Likes Received:
    36
    Correct, you can put a .htaccess file (ascii) into any directory you wish.
     
    2 people like this.
  5. Bendo

    Bendo Novice

    Joined:
    Jun 9, 2009
    Messages:
    32
    Likes Received:
    2
    First Name:
    Ben
    Of course, be aware it is easy to fake the referrer and many anti virus / internet security apps actually remove it.
     
  6. Abomination

    Abomination Zealot

    Joined:
    Jun 1, 2009
    Messages:
    1,514
    Likes Received:
    102
    good input, thanks.

    Someone else mentioned 'deny all' then, allow from www.referringsite...

    Can anyone tell me where that might be accomplished? cPanel? Ftp?
     

Share This Page