OJB Posted March 8, 2008 Posted March 8, 2008 Hello everyone, I am currently installing my new website on the new server I bought but during my local development I never really bothered fixing a problem I knew the site had. Basically, I allow users to upload stuff to folders like this: public_html/upload/1 public_html/upload/2 public_html/upload/3 they are dependant on their user_id... so in effect, user_id 1 uploads to public_html/upload/1 etc These folders are created dynamically in PHP, but I also want to restrict access so users can't get the directory listing of those created folders. The problem is, PHP allows you only (i think) to create files in the directory of the script, which is not going to be in those folders... I had planned on when i created a new folder i would also create a blank index.html to hide the dir. listing. I imagine I can block directory listing etc using a .htaccess file somewhere, problem is that I am a complete tool when it comes to .htaccess. Could someone point me in the direction of how to about doing this? Quote
TCH-Andy Posted March 8, 2008 Posted March 8, 2008 You can simply add >Options -Indexes in the .htaccess file in your public_html folder, and it will then apply to all folders. Quote
OJB Posted March 8, 2008 Author Posted March 8, 2008 awesome.. I shall give that a go... thanks andy!! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.