Software Development:
Individual Programming

Create password-protected directories with an .htaccess file

Question: 

Searching …

 

Unfortunately nothing found on "".

Premium support for Bitpalace web hosting customers only!

 from Belize: +49 30 32 70 18 92, Fax (in Germany) +49 30 32 70 18 91

service@bitpalast.net 

Skype: bitpalast

One moment please … your browser is loading the page.

 

 

Symptom

You want to limit the access to certain directories to users with a login name.

 

Cause

You can either create a password-protected directy with the .htaccess web server control or with the Plesk customer control panel. This article describes, how to use an .htaccess file to create password-protected directories.

 

Solution

1. You will need two files, an ".htaccess" file that controls the directory access and an ".htpasswd" file that contains a combination of login names/passwords. Start with creating the .htaccess text file with the following content:

AuthUserFile /[path/].htpasswd
AuthGroupFile /dev/null
AuthName "[Notice to users]"
AuthType Basic

require valid-user

Replace [path/] by a directory of your web space where the file shall be saved in that login name/password combinations are stored. You can also omit [path/], in that case the file will be stored in the home directory of your FTP login. An .htpasswd file should not be stored in a directory that can be accessed by the web server, because in could become visible on the Internet in that case.

Instead of "[Notice to users]" enter a prompt or a description of the protected directory, e.g. "Dealers only", "Price lists" or something similar.

2. Upload the .htaccess file into the directory that you want to protect with a password.

3. Create the .htpasswd file. This file stores the login name/password combinations. If you have access to a Linux shell you can create the file using the Linux htpasswd command:

htpasswd -c /[path/].htpasswd [login name]

Else use one of the many free online password generators, because the passwords in a .htpasswd-file cannot be stored in clear text, but must be encrypted. A typical .htpasswd file for two users "johndoe" and "janedoe" could look like this:

johndoe:$apr1$Q5SW6wj4$qvD3b8nBlfhdmDQLpU52/0
janedoe:$apr1$SsOahno9$ZgB3fM7U8joJwTFgLvzgd/

4. Upload the .htpasswd file to the location where it should be according to the .htaccess file setting ("[path/].htpasswd").

If the password protection does not work properly, the path to the .htpasswd file that you have entered into the .htaccess file is most likely incorrect.

 

Overview of frequently asked questions 

 

 

 


 

Additional Services

Cheap web space for less than 1 US$/month 

Starter Server: Affordable web server from  2.21 US$ () /month with PHP, database and many more 

Online Reservation System: Occupancy & vacancy schedule for any ressources (vehicles, sports facilities …) & guest houses, holiday apartments …  1.03 US$ () /month 

 

FAQ – frequently asked questions 

 

Software development (programming, programmers) in selected countries

Cuba

Austria

Kenya

Guyana

Palau

Lesotho

Antigua and Barbuda

Papua New Guinea

Paraguay

Cameroon

Argentina

Germany

Australia

Dominican Republic

Bahamas

Liberia

Barbados

Bolivia

Peru

Uganda

India

Philippines

Malawi

Botswana

Chile

Malta

Costa Rica

Puerto Rico

Ireland

Marshall Islands

Rwanda

Saint Kitts and Nevis

Saint Vincent and the Grenadines

Saint Lucia

Mauritius

Zambia

Samoa

Jordan

Mexico

Switzerland

Dominican Republic

Madagascar

Seychelles

Micronesia, Federated States of

Kiribati

Ecuador

Namibia

Sierra Leone

Nauru

El Salvador

Singapore

Fiji

Gambia

Solomon Islands

Ghana

Spain

New Zealand

Sudan

Nicaragua

Swaziland

South Africa

Nigeria

Pakistan

Tanzania, United Republic of

Colombia

Grenada

Tonga

Trinidad and Tobago

Honduras

Tuvalu

Uruguay

Panama

Venezuela

United States

Jamaica

Canada

Guatemala

Guinea

United Kingdom

Zimbabwe

 

"software development": programmer, programming, database design, interface, software developers, outsourcing, insourcing, off shore, program development, documentation, software manual, optimization, optimizing, scripting, script, revise program, revision, document software, prices for programming, Windows, Unix (z.B. Solaris, Linux, FreeBSD), Assembler, C, C++, JAVA, PHP, JavaScript & AJAX, VisualBasic, Cobol, Informix 4GL, SQL/MySQL, ADABAS, MS Access, Oracle, ARIS, Prozess 2000, Visio, MS Office (Word, Excel PowerPoint, MS Project), Automation mit VisualBasic, MS Windows Server und Clients, SAP R/3, Macromedia MX Studio, MS Frontpage, MS Expression Web, Smarty Template Engine, Joomla, Redaxo, osCommerce, OXID eSales Community Edition, OrgaMAX Web Export.

  from Belize: +49 30 32 70 18 92 •  GmbH, Sensburger Allee 27, D-14055 Berlin (Germany)
Your purchase is tax-free, because you order from a non-EU country. © 2024  GmbH. All rights reserved. and the logo are registered trademarks of GmbH. For photo credits see imprint.

Imprint Privacy policy Sitemap