Top Menu » helpdesk » hosting » secure directories

Secure directories

You can easily secure your folder on https://klant.nxs.nl. There you can create, change and delete users without needing new configuration on the server.


You can configure a number things, like your own error pages or limited access, with a .htaccess file..

You can do this by creating a .htaccess file and put it where you want. You can create a .htaccess file by creating a file in notebook and save it as .htaccess. This is without an extension and with a dot before the beginning of the word. Next you can upload this file, and what is in it will be executed. The file isn’t visible anymore on FTP servers, but it is still there. Upload the same file again: you will be asked to overwrite the file. So it is useful to create and modify the file on your own computer and then upload it..

Own error pages:

Type this in your .htaccess file:

ErrorDocument errornumber /file.html

You can fill in a few error numbers:

401 - Authorization Required
400 - Bad request
403 - Forbidden
500 - Internal Server Error
404 - Wrong page

Op de plaats van /file.html kunt u het path naar uw eigen gemaakt .html file neerzetten.

An example:

ErrorDocument 400 /errorpagina/400.html

You can fill in the path to your own created .html file instead of "/file.html"

Block IP addresses:

You can block IP addresses or ranges in the .htaccess file.

Possibilities:

allow from all - to allow everyone;
deny from all - to deny everyone;
allow from (IP-nummer) - to allow a particular IP number;
deny from (IP-nummer) - to deny a particular IP number;

An example:

deny from all
allow from 217.115.192.21
allow from 217.115.193.2

This configuration only allows people from IP 217.115.192.21 or 217.115.193.2 to visit the folder or file.

Secure with username and password

You can secure your directory with a username and password via a .htaccess file.

What you should type in the file:

AuthUserFile password file
AuthName section name (full path)
AuthType Basic
require valid-user

If someone visits a file from the folder, he will see two sections (username/password) and the following words:

Enter username for section name

The section name is the name that you have given to the secured section. You can secure several folders with the same section name. As a consequence, the user only has to log in once for the whole section.

You can put the username/password combination in a different file, the password file. The data is encrypted so that nobody seed the data when opening the file. You can have your file encrypted on the following page:

http://www.inch.com/commercial/web/server/apache/htpasswd.html


Print this page
 
 
Terugbellen