tires Posted July 15 Posted July 15 I need a very simple htpasswd protection for my staging installation. So I inserted these lines into the processwire .htaccess at the very beginning: AuthType Basic AuthName "protected" AuthUserFile /usr/home/dev/.htpasswd Require valid-user The file .htpasswd contains the following code (i.e. admin / admin): admin:$2y$10$yuBaR6xKApq7F1BmOXyzbeEz3kQBpuI5p4TJCvRD4VXP2MRmIoBFy For some reason i get a 404 after login.
ngrmm Posted July 15 Posted July 15 @tires I can't help you with the htaccess But you could just use ProtectedMode https://processwire.com/modules/protected-mode/ 1
tires Posted July 16 Author Posted July 16 17 hours ago, ngrmm said: @tires I can't help you with the htaccess But you could just use ProtectedMode https://processwire.com/modules/protected-mode/ Thank you for your answer. I had already seen the module. Nevertheless, I would prefer a simple solution directly via the htaccess file. If there is a solution?
cwsoft Posted July 16 Posted July 16 Required something similar some time ago. Maybe this topic is helpfull for you. Be aware that basic auth can be switched off by group policy rules in Windows by system admins. In this case the user will only see a forbidden page and no login form at all. Thats why I finally added a frontend login via PW API myself, which worked just fine. 2
tires Posted July 21 Author Posted July 21 On 7/16/2025 at 10:19 PM, cwsoft said: Required something similar some time ago. Maybe this topic is helpfull for you. Be aware that basic auth can be switched off by group policy rules in Windows by system admins. In this case the user will only see a forbidden page and no login form at all. Thats why I finally added a frontend login via PW API myself, which worked just fine. Thank you!!! So you just have to put the code at the end of the htaccess file? Is that the only trick?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now