Here's the script:
There is a Git repository that tracks website files, including .htaccess from root. Git repo is tested at the intermediate site and at the production site.
Problem: The website must be password protected (via htpasswd authentication). It also modifies the .htaccess file. Now committing or clicking from the staging environment means that the .htaccess file (which includes password protection for the root directory) is also uploaded to the website live, forcing the website to also request a password.
Now, what should I do? Should I stop tracking .htaccess ? Should I rewrite .htaccess through the hook after receiving (maybe? How?)? Is there any other way to protect the directory without changing .htaccess ? Any other solution?
Sawant
source share