Page 1 of 1

How can I password protect a directory?

Posted: Sat May 24, 2014 3:52 am
by pankaj
Hi,

I'm new to VestaCP and I want to know how can I make a directory password protected?

Thanks

Re: How can I password protect a directory?

Posted: Sat May 24, 2014 11:52 am
by drMacFaulty
It's up to you, you can choose to use htpasswd (put it outside your public_* folders) in conjunction with htaccess. See here for details: http://www.addedbytes.com/blog/code/pas ... -htaccess/ Though it would be better to not use .htaccess AT ALL and define it in you vhost configuration (much safer, neater and cleaner IMHO). Nginx (if used) might also need a rewrite (depending what contents are inside and what contents are handled by nginx) if I'm correct.

Hope this helps :)