How can I block access to all or part of my site? Print

  • 30

You can limit (protect) access to all or part of your sites in a fairly simple way by using the interface provided for this purpose by your control panel. To access the blocked/protected area, the user will be required to enter a name/login and a password. This method is safe as it is the server that manages the access.
In practice, this method allows you to block or protect access to everything in a directory and its subdirectories. For example, you can protect access to your entire site or to one (or more) specific subdirectories of your site, such as the administration/management area of your site (provided that access is in a subdirectory of your main site).

Here is how to proceed to protect access to your entire main site. As explained above, you can use the same procedure to block access to any specific subdirectory of your site:

  1. Log in to your control panel
  2. ;
  3. In the "FILES" tab, select the "Directory Privacy" icon:
    Limiter l'accès à un répertoire ou dossier

  4. In the configuration area, you can select the directory you want to protect. In our example, we will choose "public_html" to protect the whole default site (in red on the image below). But you can navigate in the subdirectories by clicking on the icon/image to the left of the directory name (in blue on the image below) rather than on the directory name. To go back to the parent folder you have to click on the folder named "Up one level" (either on the icon/image or the name):
    Limiter l'accès à un répertoire ou dossier

  5. Once you have selected the folder to protect, you will access the interface to define the protection, start by checking the box "Protect this folder by password
  6. " ;
  7. In the field "Enter a name for the protected directory" enter the message that will appear when a user tries to connect to it. For example "This directory is accessible to Premium customers only". Then click on "Save" to validate your welcome message:
    Limiter l'accès à un répertoire ou dossier

  8. Click on "Back" once you have confirmed the creation of your welcome message:
    Limiter l'accès à un répertoire ou dossier

  9. You can now manage the users who have access to your directory:
    Limiter l'accès à un répertoire ou dossier

    • Enter the "User Name
    • ", which will be the name to use to access this directory. We advise you to avoid spaces;
    • Enter or generate the "Password
    • " that will be used to access this directory;
    • Click on "Save

" to validate the registration of this new user.

Tips:

  • If you do not add a user, the directory will simply be inaccessible to
  • everyone;
  • Using this same process you can manage the users
  • who have access to your protected directory, so you can add a new user, delete a user or change the password of a user;
  • To change the password of a user
  • you just have to add him/her again (same name) using the new password;
  • If you don't want to protect a directory anymore, you just have to uncheck the box "Protect this directory by

password" so that it becomes accessible again without the need to enter a name and a password.


Was this answer helpful?

« Back