RewriteCond for password protected folder
Hi, i see from the docs that for the Password Protected Folders feature you use the Authtype of "basic". I did some reading on that via the apache docs also but i did not find my answer.
I want to do a custom 401 page for the password protected folder but am not having any luck. I have custom pages for 403, 404 but the custom page for 401 is not working.
In my htaccess file i have the following:
AddType text/html shtml
#custom 401 error document
ErrorDocument 401 /401.shtml
That should be enough for it to work. So what tried next was to use mod rewrite on it like i have done with a custom 404 page before, here is an example of that 404 code
# Set 404 missing file Custom Error File
# using Current Folder
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* 404.shtml [L]
However, in order to do this for the 401 page i need to know the proper RewriteCond for the password protection. So what i am asking is for this:
RewriteCond %{WHAT GOES HERE} !-f
RewriteCond %{WHAT GOES HERE} !-d
I have not been able to find an example of what goes inside the brackets for this particular need.
Thanks :)
Please sign in to leave a comment.
Comments
0 comments