How To Password-Protect A Directory using .htaccess
HOW TO PASSWORD-PROTECT A DIRECTORY USING .HTACCESS The .htaccess file is a configuration file for the Apache HTTP server. .htaccess includes a series of directives that control how the server responds to requests. (A "directive" is just a text command/keyword followed by its value.) One of the more common usages of .htaccess is to enable a directory to be password protected. By adding appropriate directives to .htaccess, when a web user accesses a file in that directory or a subdirectory, they’ll be prompted for a username and password. DIFFICULTY Basic - 1 | Medium - 2 | Advanced - 3 TIME REQUIRED 15-30 min RELATED PRODUCTS Linux-based VPS or dedicated servers cPanel Shared Hosting Linux-based Web & Classic Hosting RECIPE Assuming AllowOverride and AuthConfig are enabled in the main configuration file, directives similar to the following will enable the current directory tree to be password protected with basic authentication for user bla...