Hi. I need to setup Apache Basic Auth to ask usr/password in all pages of my website, and exclude some of them.
I've done this in several ways that Apache accepts (methods 1 through 3) and, in Apache, they're working flawlessly.
Now, when I upload the same .htaccess to my hosting provider (Banahosting.com), their LiteSpeed server is blocking all pages, it's ignoring completely the directives to exclude those specific pages.
The .htaccess file is in the directory I would like the access restrictions to be applied, and contains this (right now METHOD 1 is active, all other commented out, but in Apache they work OK):
---------------------------------------------------------------
---------------------------------------------------------------
Do you support any synthax to tell LiteSpeed to "accept" those urls?
I've done this in several ways that Apache accepts (methods 1 through 3) and, in Apache, they're working flawlessly.
Now, when I upload the same .htaccess to my hosting provider (Banahosting.com), their LiteSpeed server is blocking all pages, it's ignoring completely the directives to exclude those specific pages.
The .htaccess file is in the directory I would like the access restrictions to be applied, and contains this (right now METHOD 1 is active, all other commented out, but in Apache they work OK):
---------------------------------------------------------------
Code:
AuthType Basic
AuthName "Login"
AuthUserFile "security/.htpasswd"
# METHOD 1
SetEnvIf Request_URI ^/private/(page.php|ajax/.*) noauth=1
<RequireAny>
Require env noauth
Require env REDIRECT_noauth
Require valid-user
</RequireAny>
# METHOD 2
#Require expr %{REQUEST_URI} = m#^/private/page.php#
#Require expr %{REQUEST_URI} = m#^/private/ajax/.*#
#Require valid-user
# METHOD 3
#Require expr %{REQUEST_URI} in {'/private/page.php', '/private/ajax/res1.php', '/private/ajax/res2.php'}
#Require valid-user
Do you support any synthax to tell LiteSpeed to "accept" those urls?
Last edited by a moderator: