How to add a passwor for a page

how to restrict access to a html page using a login and password?
thanks
 
If you only want to protect a single file instead of a Directory, you should probably search google on howto create the necassary .htaccess files.
 
Here you go:

1. Open any plain text editor
2. Copy and paste the content below
3. Save it as .htaccess
4. Upload to the directory where the file resides

<FilesMatch "filename.html">
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /path/to/.htpasswd
require valid-user
</FilesMatch>

nb:
replace FILENAME.HTML with the file you want to protect
replace PATH/TO/.htpassword with the location of your htpasswd file.

Nigel
 
Hello

How to protect file with password, not directory

I found advice how to create .htaccess file, I did it but this isn;t good

Help please
 
what i have posted above will protect a file NOT a directory
 
Back
Top