Vidensdatabase

knowledgebase

ypsilon.kb.documentation
Server & Hosting Management

Restricting Access to Files

  • 14 Hjalp dette svar dig?

Sometimes you need to outright deny web browsers from accessing specific directories, configuration files, or internal scripts.

Denying Access Using .htaccess (Linux)

If you are on a Linux hosting plan, Apache uses hidden `.htaccess` files to control directory settings. To block all access to a specific folder:

  1. Go to the File Manager.
  2. Navigate into the folder you want to hide from the public (e.g., `/httpdocs/config`).
  3. Click `+` > Create File and name it exactly .htaccess.
  4. Click on the new file to open the code editor.
  5. Type the following exactly: Require all denied
  6. Click Save.

Now, if anyone tries to visit yourdomain.com/config, the server will block them instantly!

Virtual Directory Security (Windows)

If you are using Windows hosting, you can manage this right from the Plesk UI:

  1. Go to Virtual Directories.
  2. Click on the Directory Access Permissions.
  3. You can easily uncheck Read and Write permissions for the web visitor user groups, ensuring the files can only be accessed internally by your scripts.

Hjalp dette svar dig?

Relaterede artikler