---
title: "Secure Directory on RHAP"
canonical: "https://kb.uconn.edu/space/IKB/10749248541/Secure%20Directory%20on%20RHAP"
format: markdown
---
To secure a directory, you must place a file named ***.htaccess*** in the desired directory (i.e., Secure).

Example: */home/netID/edu.uconn.sitename/public_html/secure/.htaccess*

## Examples

### Allow Anyone with a Valid NetID access:

AuthType CAS  
require valid-user

### Allow Only Certain Users Access:

AuthType CAS  
require user NetID1  
require user NetID2

To capture the NetID of the user who is logged into the secure directory, use the following code in your index.php file in the secure directory:

*$netid=$_SERVER['REDIRECT_REMOTE_USER'];*

## Related Articles

> Macro (contentbylabel)