allow public access to subfolder of protected folder on apache

Posted by UnnamedMook on Super User See other posts from Super User or by UnnamedMook
Published on 2011-12-18T00:14:02Z Indexed on 2012/06/17 21:19 UTC
Read the original article Hit count: 162

Filed under:
|

I have password-protected the root folder of my website while i do maintenance, but I want to display a custom 401 error page to let people know the site is under construction. Unfortunately, my web host doesn't allow me write access to anything outside the root folder of my website, so this custom error page must by stored in the root folder or one of its subfolders. Instead of my custom error page I get the Apache default error page and it also says "Additionally, a 401 Authorization Required error was encountered while trying to use an ErrorDocument to handle the request."

I searched for ways to make a subfolder of a protected directory public, and all I could find was to use the "Satisfy any" directive, but this doesn't work for me. It doesn't work on a file-only basis either, as with the .htaccess file below.

#Authorization Restriction
AuthType Basic
AuthName "Access to root"
AuthUserFile *********************************
Require user ***********

Order Allow,Deny

Satisfy any

#Error Documents
ErrorDocument 401 Error-401.html

#Allow access to error documents
<Files Error-*,html>
Order Deny,Allow
Allow from all
Satisfy any
</Files>

I can only use .htaccess files; I don't have access to httpd.conf

© Super User or respective owner

Related posts about apache

Related posts about htaccess