www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manuel Lemos <mle...@acm.org>
Subject config/2564: Overriding a .htaccess definitions in a subdirectory
Date Tue, 07 Jul 1998 20:43:26 GMT

>Number:         2564
>Category:       config
>Synopsis:       Overriding a .htaccess definitions in a subdirectory
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Tue Jul  7 13:50:01 PDT 1998
>Originator:     mlemos@acm.org
>Release:        1.2.5
SunOS chase.adgrafix.com 5.6 Generic_105181-06 sun4u sparc SUNW,Ultra-1
And any other OSes I tried.
This is the message that I posted to comp.infosystems.www.servers.unix :

Anybody can help to figure why Apache 1.2.5 says I can't access the default
directory file unless the user agent indicates it's complete URL

I have manage a server with a virtual domain, let's say on at www.main.com
and the other at www.virtual.com:

The main files are in htdocs directory and the virtual files are in a
subdirectory named virtual.  httpd.conf contains the virtual host
definition as follows.

<VirtualHost www.main.pt>
ServerName www.main.pt
DocumentRoot /apache/htdocs/
TransferLog logs/main-access_log
ServerAdmin webmaster@main.net
ErrorLog logs/main-error_log

<VirtualHost www.virtual.com>
ServerName www.virtual.com
DocumentRoot /apache/htdocs/virtual
TransferLog logs/virtual-access_log
ErrorLog logs/virtual-error_log
ServerAdmin webmaster@virtual.com

access.conf contains the definitions as follows.

<Directory /apache/htdocs/>
AllowOverride FileInfo Indexes
order allow,deny
allow from all

<Directory /apache/htdocs/virtual>
AllowOverride FileInfo Indexes
order allow,deny
allow from all

The main .htaccess file is defined as follows:

DirectoryIndex frames.html index.html
<Files *>
deny from all
<Files virtual/*>
allow from all
<Files ~ "(index|frames|access_error)\.html">
SetHandler application/x-httpd-php3
allow from all
ErrorDocument 403 /access_error.html?error=403
ErrorDocument 404 /access_error.html?error=404

The virtual .htaccess file that ins in virtual subdirectory is defined as

DirectoryIndex index.html
<Files ~ "(index|error)\.html">
allow from all
ErrorDocument 403 /error.html
ErrorDocument 404 /error.html

What happens is that if the user agent asks for http://www.virtual.com/
Apache serves the error.html document.  But if the user agents asks for
http://www.virtual.com/index.html it serves index.html file ok.

I also discovered that if I remove the lines in main .htaccess file that say

<Files *>
deny from all

accessing http://www.virtual.com/ works fine serving index.html as desired,
but I can't remove those lines or else the server will let any private
files not meant for public access to be reachable.

Anyone has any idea of why this is not working?
Try http://www.mastmix.com/ .  It should appear the same page as
http://www.mastmix.com/index.html but it appears as
http://www.mastmix.com/error.html .

[In order for any reply to be added to the PR database, ]
[you need to include <apbugs@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]

View raw message