March 8, 201016 yr Hi, I think this is the most suitable forum for this... I have a folder on my website called 'files' I'd like a way to make it so nobody can access files by typing it in the address bar. The ONLY way I want it to be accessed is where users can use a directory script I have made to download the files in the folder. Other than that I would like all access restricted. I'm presuming it would be done with .htaccess but I'm a bit of a beginner when it comes to that. Could anybody point me in the right direction? Thankssssssssssss!
March 8, 201016 yr Oh the glorious land of htaccess! What type of directory script do you mean? If it's for certain users, you can provide a password to the users to download the files --> http://www.htaccesstools.com/htpasswd-generator/
March 8, 201016 yr Author I already have a whole login user system so it's just basically restricting access from the address bar...
March 8, 201016 yr create a .htaccess file in your 'files' directory and add this deny from all this will stop anyone accessing anything in the folder. your script will still be able to process any file in the folder unless it does a http request to get the file, in which case just allow your server access to it order allow deny deny from all allow from [your server ip here]
March 9, 201016 yr I think I would probably password protect the folder through the control panel for the hosting. My hosting company control panel has an option for this, I don't know if it's an option for you.
March 9, 201016 yr I think you can do this in the control panel without editing the .htaccess. Under Index Management, just choose no index and I think it will restrict access to that folder.
Create an account or sign in to comment