Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I protect a folder?

    Hi. Sorry if this has been asked before...

    Got a site up and running. I have a special folder called say "Hideout" where I have some php files with passwords that are needed for a script to run.

    I don't want anyone getting into or downloading the contents of Hideout.
    However, I know there are programs out there like siteripper that can download all the files from a server...

    I've already added a robots.txt file to disallow search engine robots, but how do I block everyone else from getting into this folder? Is there a way to basically block everyone or make the folder invisible?

    Running standard cpanel, apache, shared hosting.

    Thanks!


  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Use .htaccess to password protect it.

    So many sites out there showing you how to do this that you may as well just look through some of the sites on Google.

  • #3
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Is this a php include file or something? If it just has some php code in it thats ment to be included in another file, if you end it with a php extension, nothing will get sent to a user if they request the file.

    Those siteripper tools can't download the file from the server before the PHP engine processes it.
    OracleGuy

  • #4
    Regular Coder croatiankid's Avatar
    Join Date
    Jan 2006
    Posts
    665
    Thanks
    1
    Thanked 12 Times in 12 Posts
    php: hypertext PREproccessor, as in BEFORE it gets sent to the client- as oracleguy said, if it has a php extension, there's no way that you can see the contents of it without having ftp access.

  • #5
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,092
    Thanks
    2
    Thanked 23 Times in 23 Posts
    Another thing you might do is put the folder outside of the publicly accessible directory tree for your site. For example, my publicly accessible root folder is:

    /home/username/public_html/

    I have my passwords folder located in:

    /home/username/secure_folder/public_html/
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •