Jump to content

.htaccess Question


Recommended Posts

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:






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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...