Fork me on GitHub

Script, stopping people typing in direct URL to it only by..  Bottom

  • Hello, I am using an AutoTheme as my theme, and I have or am adding
    an uploading script which is completly seperate to postnuke, but want to
    know how you only let people use the script by going to your website
    and not going to the direct link to the script.. I mean do I add something in
    a .htaccess file or something icon_lol

    Is this possible, here are some nice pictures for you to look at :P

    The button (link) on the website (postnuke site) linking to the program,
    upload script

    http://premium.uploadit.org/musicmatters/uploaderprpn8931.JPG

    When you click that it takes you to a seperate screen:

    http://premium.uploadit.org/musicmatters/uploaderprpn8932.JPG

    Where the upload script is which I want to load and only be accessable
    by going to the website and not using a direct link to the script


    Can any of this be done, please help


    Thanks
  • I've tried something, in a .htacess file...

    Can we only stop hotlinking to only one file in one directory and not the
    others. Because a script I have I want to protect the log in page so that
    people from the main site can only log in and people typing in the URL into
    there browser cannot without going to the main site, the file that needs
    protecting is the index.php (log in page), all the file unfortunatly have to be
    in one directory.. so I cannot have other files outside the default one

    So is there a possibility of just protecting one file


    Best regards & thanks
  • http://forums.postnuke.com/index.php?name=PNphpBB2&file=viewtopic&p=103329#103329

    Assuming your file is called uploadscript.zip, and you're hosted on an apache server (likely) with the URL module active, try this in your .htaccess file:

    Code

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com/.*$ [NC]
    RewriteRule .*uploadscript\.zip$  - [F]
    where of course www.yoursite.com is replaced with your site URL

This list is based on users active over the last 60 minutes.