.htpasswd in codeigniter
snippet in htaccess

.htpasswd in codeigniter

user5057

# password-protect single file
<Files my_controller>
AuthName "my_controller"
AuthType Basic
AuthUserFile /home2/afolder/.htpasswds/.htpasswd
require valid-user
</Files>