Preventing type-in access to URL

Discussion in 'PHP' started by grevan, Nov 13, 2008.

  1. #1
    Hello to all.
    This is my issue: I created several directories with pictures in one domain.
    In another domain i created links pointing to my picture´s folders.
    I want to only allow access to those folders if the person comes from the links i mentioned. I don´t want type-in access to those folders.
    I tried some hotlink protection with .htaccess, but they don´t protect from type-in.
    Any suggestions? Thanks a lot guys.
     
    grevan, Nov 13, 2008 IP
  2. atlantaazfinest

    atlantaazfinest Peon

    Messages:
    389
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    my only suggestion would be to create a script that uses php to generate the image and add refferal if statements to it. And i believe u and do some crafty htaccess work to block all access except for ones with your specific refferal.

    Have u tried this?


    
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
    RewriteRule \.(gif|jpg|js|css)$ - [F]
    
    Code (markup):
     
    atlantaazfinest, Nov 13, 2008 IP
  3. grevan

    grevan Member

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    Yes, i tried this code. But doesn´t protect type-in.
     
    grevan, Nov 13, 2008 IP
  4. atlantaazfinest

    atlantaazfinest Peon

    Messages:
    389
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yea i think the best way to go is creating the php script that calls the images ... but if the refferer is not the one you want do something else.
     
    atlantaazfinest, Nov 13, 2008 IP