Jump to content

Recommended Posts

Posted

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.

 

Posted

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. 

  • Like 2
Posted
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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...