Global passwd file?
Because we develop client websites on test domains and want to preview people from browsing the sites (and google) until they are published on the final domain I would like to setup a global rule for a single passwd file to be used.
So when the site is using a subdomain of our main test domain (i.e. xyz.example.com) the passwd file should be applied.
I've tested it with SetEnvIfNoCase and it works fine.
The problem I have is that AuthType can only be used inside so I can't add these rules in my WHM include editor.
Any ideas how I do this? presumably with a template file?
-
Found my own answer to this one... You can use a wildcard in SetEnvIfNoCase ^HOST$ .+ unauthenticated SetEnvIfNoCase ^HOST$ ^(.*)\.testdomain\.com$ !unauthenticated AuthType Basic AuthName "Restricted Development Link" AuthUserFile "/home/.htpasswds/passwd" Require valid-user Order allow,deny Allow from env=unauthenticated Satisfy any0 -
Hello :) I am happy to see you were able to find a viable solution. Thank you for updating us with the outcome. 0
Please sign in to leave a comment.
Comments
2 comments