If you're using a static app ie...
- You chose "Nginx Static Only" when you created the app and...
- The app type is "Static" in the app list in the dashboard
...then there's the problem: those apps are served directly from the front-end Nginx server, and Nginx doesn't support per-directory configuration with .htaccess
files.
At this time we don't support password protection for Static apps, so if you need that you'll need to use a PHP+Apache app type.
General instructions are available in our documentation: Password Protection for PHP Applications | Opalstack Support Center
You might need to tweak things for your specific needs.
If you don't want to move your files into a new app directory, then you can keep them in your existing Static app and do the following:
- Create a new "PHP+Apache (Symbolic Link)" application, using your original app directory (
/home/user/apps/static/
or whatever) as the symlink path.
- Edit your site route to change the site app from the static app over to the new symlink app.
Once that's done and the changes have propagated to the web server, then your existing app directory will be served by Apache, via the symlink app, so your .htaccess
stuff will work correctly.