>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 >Last-Modified: >Originator: [EMAIL PROTECTED] >Organization: apache >Release: 1.2.5 >Environment: SunOS chase.adgrafix.com 5.6 Generic_105181-06 sun4u sparc SUNW,Ultra-1 And any other OSes I tried. >Description: 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 (/index.html). 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 [EMAIL PROTECTED] ErrorLog logs/main-error_log </VirtualHost> <VirtualHost www.virtual.com> ServerName www.virtual.com DocumentRoot /apache/htdocs/virtual TransferLog logs/virtual-access_log ErrorLog logs/virtual-error_log ServerAdmin [EMAIL PROTECTED] </VirtualHost> access.conf contains the definitions as follows. <Directory /apache/htdocs/> AllowOverride FileInfo Indexes order allow,deny allow from all </Directory> <Directory /apache/htdocs/virtual> AllowOverride FileInfo Indexes order allow,deny allow from all </Directory> The main .htaccess file is defined as follows: DirectoryIndex frames.html index.html <Files *> deny from all </Files> <Files virtual/*> allow from all </Files> <Files ~ "(index|frames|access_error)\.html"> SetHandler application/x-httpd-php3 allow from all </Files> 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 follows: DirectoryIndex index.html <Files ~ "(index|error)\.html"> allow from all </Files> 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 </Files> 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? >How-To-Repeat: 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 . >Fix: no. >Audit-Trail: >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include <[EMAIL PROTECTED]> in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [automatically because of the potential for mail loops. ]
