Syspect
Syspect

Reputation: 921

How to secure a folder access through .htaccess?

So I have a folder that going to be used for storing some files (pdf) but I need to restrict access to it from the web, and I was suggested to do it with .htaccess configuration file. The problem is that I literally have no clue what to write in the file. I have looked onto example from other file in the project but that didn't help.

The thing is that these files should be available for uploading, in the folder, through FTP/SFTP or SCP.

Upvotes: 1

Views: 73

Answers (1)

anubhava
anubhava

Reputation: 785481

Approach 1:

You just need to create a .htaccess file in that folder with this line:

Deny from all

Approach 2:

Move that folder a level above your DOCUMENT_ROOT

Upvotes: 3

Related Questions