Apache Protect Multiple Locations

The configuration directive below is one I used to protect multiple URLs with a htpasswd file.

So match (~) /url01/ or (|) /url02/ or (|) ….

<Location ~ “/url01/|/url02/|/rfinlay1/|/cgribb5/|/lgrw01/|/ahll7/|/cki3/|/ele02/|/mm24/|/cmcc78/|/jmc8/|/gmc1/|/mmy82/|/eoa1/|/cs01/|/pr5/|/ln50/|/rc1/|/hd01/|/a05/|/e1/|/ss12/|/mm6/|/s75/|/gp01/” >
AuthUserFile /etc/httpd/conf/.htpasswd-file
AuthName “Restricted Access”
AuthType Basic
Require valid-user
</Location>

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>