How to make a file password protected
You need to use htaccess to make a single file password protected and add these lines in to it.
AuthName “Restricted Area”
then run command
htpasswd -b .htpasswd username password