content.html
<!DOCTYPE html>
<html>
<head>
<title>Secret Page</title>
</head>
<body>
<h1>Here it is!</h1>
<p>I bet you are glad you can see this secret page.</p>
</body>
</html>
rejection.html
<!DOCTYPE html>
<html>
<head>
<title>Rejected Page</title>
</head>
<body>
<h1>Go Away!</h1>
<p>You are not authorized to view this resource.</p>
</body>
</html>
cd /var/www/html/php-books/php-and-mysql-web-development/chapter16/using-basic-authentication-with-apaches-htaccess-file-pag-374/
touch .htaccess
chmod 775 .htaccess
AuthUserFile /var/www/.htpass
AuthType Basic
AuthName "Authorization Needed"
AuthBasicProvider file
Require valid-user
ERRORDocument 401 /var/www/html/php-books/php-and-mysql-web-development/chapter16/using-basic-authentication-with-apaches-htaccess-file-pag-374/rejection.html
It should appear error 401 in the server the page is rejection.html