Password protect dev site

Has anyone managed to password protect the whole site using apache? I have tried the below and it sort of works but goes straight to the error page. It’s complaining about access to the manfest file and service-worker.js

Options Indexes FollowSymLinks MultiViews Order deny,allow Allow from all Authtype Basic Authname "Password Required" AuthUserFile /etc/apache2/.htpasswd Require valid-user