# Do the regex check against the URI here, if match, set the "require_auth" varSetEnvIf Request_URI ^/pretty/url require_auth=true
# Auth stuffAuthUserFile /var/www/htpasswdAuthName "Password Protected"AuthType Basic
# Setup a deny/allowOrder Deny,Allow
# Deny from everyoneDeny from all
# except if either of these are satisfiedSatisfy any
# 1. a valid authenticated userRequire valid-user
# or 2. the "require_auth" var is NOT setAllow from env=!require_auth
This article's original url :
https://stackoverflow.com/questions/14603568/password-protect-a-specific-url