How to create a website

February 10, 2010

Protect your website with password

Filed under: Uncategorized — how2createwebsite @ 8:24 pm

Sometimes you do not want that your visitors can see already your web pages, but a part of your Internet site makes only accessible for a certain group visitors. Here read you how you can protect a part of your Internet site. For which rather looks at then reads, there are also videotutorial available.

Where you must start, separate directory on your server are to produce, where you soon your members refer naartoe. I have called those directory Alleen-voor-leden, but you can him give of course each name which you want. Within those directory place you a file that index.html is called. You have made this resistant special your members.

Please note: You have now therefore two files on your Internet site which index.html are called: one your hoofddirectory and one your Alleen-voor-leden-directory. Just on that you accidentally do not commitment new index-bestand your hoofddirectory: index-bestand that state becomes there then transferred and your homepage come look forward to there all of a sudden complete differently!

The next code now production an empty file with your html-editor or draft block-system and plak:

AuthUserFile /exacte/path/naar/.htpasswd
AuthGroupFile /dev/null
AuthName protected page
AuthType Basic
<Limit GET POST>
require valid-user

The path fills in to resistant at AuthUserFile the .htpasswd that soon in your protected folder comes stand. The rest takes away you. In my case it comes look forward to there for example this way: AuthUserFile /home/httpd/vhosts/

(In vragen-gedeelte of this Internet site read you how you can come what the exact path to your protected folder are.)

The text replaces protected page in the code by the title which you want give to the guard word window (let the quotations mark stand). Visitors get this text if to see they protected files from your directory want examine.

Lettuce the file on under the name .htaccess (in the directory to protect).

If you want a folder of your Internet site protect, further still a file needs you that .htpasswd are called. An empty document therefore now production that you store .htpasswd under the name. (NB: both file names (.htaccess and .htpasswd) start therefore with a point!)

Take on this the user names and passwords, in the next manner: username: password

For username choose you a word that you as a user name wants use; for password you must choose a word that you leave vervolgens versleutelen by so-called htpassword-gateway. In for that the intend fields, and fill in the password fill in the chosen username and password once again in the profession Verify. Click then on Add/Update and you has the contents for your .htpassword-bestand.

For the beveiliging of our directory I the user name has therefore filled in Internet site and the password protect. This produced the next text for my .htpassword-bestand: Internet site: Se03rN5flBqNw.

Upload finally both files to the directory which you want protect. Do not place them in the hoofddirectory of your site, differently you complete site is protected and can nobody your homepage more see!

If you have put the two files in the directory, you can no longer see them with your ftp-programma. But they stand there. Nevertheless still want you them are able examine (them to be able remove for example), then do you this in Core FTP (ftp-programma that I use ours files at uploaden), by in the directory will stand (for example on another one resistant which itself in this is), then on the rechtermuisknop click and choose for Directory Commands – trick vogue – Advanced. Now to see you .htaccess-bestand and .htpassword-bestand, however, standing.

As from these Alleen-voor-leden-homepage can introduce you of course left to other pages the same directory. Visitors who ask direct one of those subpagina’s, get the inlogscherm also firstly before to see they are possible further.

It seems that this manner of a Internet site only protect on Apache-webservers work. Thus you do not succeed on the bovenbeschreven manner, question after what the type of server is your webhosting true provider of uses then firstly once.

And check well if you, however, the correct path has filled in file to your .htpasswd. Because come you but in your folder did not protect, then there is a large chance that you have indicated the path not well.

P: To see how e.e.a in practice work, go to the protected part of our own Internet site. Your logt with: user name protects Internet site and guard word. You arrive then on a page with the same text such as the present page, only that page is himself in a folder which has been protected by means of htaccess.


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: