You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2002/04/25 23:02:16 UTC
DO NOT REPLY [Bug 8533] New: -
htaccess containing ErrorDocument directives overrides other htaccess files?
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8533>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8533
htaccess containing ErrorDocument directives overrides other htaccess files?
Summary: htaccess containing ErrorDocument directives overrides
other htaccess files?
Product: Apache httpd-2.0
Version: 2.0.35
Platform: PC
OS/Version: Windows 9x
Status: NEW
Severity: Normal
Priority: Other
Component: Config
AssignedTo: bugs@httpd.apache.org
ReportedBy: slowhandz@netscape.net
Hello,
I believe there is problem (bug?) with .htaccess
in the new Apache for Windows:
Apache 2.0.35 [3.1M] - 09-Apr-2002 - MSI Installer Package
http://www.apache.org/dist/httpd/binaries/win32/apache_2.0.35-win32-x86-
no_ssl.msi
I installed into C:\Apache2
(I still have Apache 1.3.22 in C:\Apache).
I have a .htaccess file in DocumentRoot: C:\Apache2\htdocs\.htaccess
that looks as follows:
Options -Indexes
ErrorDocument 401 /error/401.php
ErrorDocument 403 /error/403.php
ErrorDocument 404 /error/404.php
ErrorDocument 500 /error/500.php
-----------------------------------------------------------------------
My httpd.conf (just the stuff pertaining to htaccess and errors):
DocumentRoot "C:/Apache2/htdocs"
<Directory "C:/Apache2/htdocs">
Options Indexes FollowSymLinks Multiviews Includes ExecCGI
AllowOverride AuthConfig FileInfo Options Limit
Order allow,deny
Allow from all
</Directory>
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</Files>
and since I declare my ErrorDocument files within the
.htaccess in DocumentRoot, I commented out ALL references
to the following in httpd.conf:
#<IfModule mod_negotiation.c>
#<IfModule mod_include.c>
# Alias /error/ "C:/Apache2/error/"
# <Directory "C:/Apache2/error">
# AllowOverride None
# Options IncludesNoExec
# AddOutputFilter Includes html
# AddHandler type-map var
# Order allow,deny
# Allow from all
# LanguagePriority en es de fr
# ForceLanguagePriority Prefer Fallback
# </Directory>
# ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
# ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
# ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
# ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
# ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
# ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
# ErrorDocument 410 /error/HTTP_GONE.html.var
# ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
# ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
# ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
# ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
# ErrorDocument 415 /error/HTTP_SERVICE_UNAVAILABLE.html.var
# ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
# ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
# ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
# ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
# ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
#</IfModule>
#</IfModule>
----------------------------------------------------------------------
OK, here is the problem:
I have OTHER .htaccess files in other directories
used for User Authentication:
i.e. C:\Apache2\htdocs\protected\.htaccess
AuthUserFile "C:/Apache2/mydata/.htpasswd"
AuthName "Administration Area"
AuthType Basic
require valid-user
When I try to access this directory:
http://localhost/protected/
I SHOULD be getting a login prompt
(WHICH IS WHAT HAPPENS IN APACHE 1.3.22).
In Apache 2.0.35, I get routed to:
http://localhost/error/401.php
WHICH IS 401 - AUTHORIZATION REQUIRED!!.
I HAVEN'T BEEN PROMPTED FOR A PASSWORD YET!?
This should only happen *AFTER* I enter a
WRONG USERNAME or PASSWORD !!!
In effect, the .htaccess file I have in DocumentRoot
is overiding all other .htaccess files??
When I REMOVE the .htaccess file out of DocumentRoot,
I then get the login prompts for all
.htaccess protected directories!!
Let me repeat... this works fine in Apache 1.3.22,
with the .htaccess file in root containing the
ErrorDocument directives...
The only difference between the 2 installs is the
AuthUserFile paths in the .htaccess directives:
(which is of course required)
AuthUserFile "C:/Apache2/mydata/.htpasswd"
vs.
AuthUserFile "C:/Apache/mydata/.htpasswd"
Is there some NEW way of declaring the ErrorDocument
directives WITHIN a .htaccess file in Apache 2.0.35?
This problem is certainly reproducible...
whether it's a bug or not... ?
Steve
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org