That link is essentially what I am using now. However in order for it to work, you modify the .htaccess code. Since I’m only using .htaccess/.htpasswd on the staging site, that wont work for keeping .htaccess in version control.
I’m leaning toward not using .htaccess for the security, and just using a WordPress plugin.
Have you ever tried to using a maintenance mode plugin? Easy Maintenance Mode
Just search for Easy Maintenance Mode. This allows only admins to login. There was another one that I used that you could allow certain IP’s, but can’t remember which one it was.
That one looks pretty good, and allows easy access. The one I posted, you kinda have to go through a few more hoops. You use to be able to add an IP, then they would get full access, but now that’s in the paid version.