httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jsl...@gmail.com>
Subject Re: [users@httpd] elaborate: htaccess subdirectory, and RewriteOptions behaviours
Date Mon, 11 Apr 2005 14:10:51 GMT
On Apr 10, 2005 11:03 PM, krystian@mindspring.com
<krystian@mindspring.com> wrote:
> Suppose a directory structure exists as such:
> 
> (0)          /home/user
> (1)          /home/user/public_html
> (2)          /home/user/public_html/subdirectory
> (3)          /home/user/public_html/subdirectory/subdirectory
> 
> Where a particular, but arbitrarly chosen domain, www.somedomain.com, when
> accessed, references /home/user/public_html on some server.
> 
> As I understand, htaccess rules within subdirectory (2) are inherited from
> the parent directory's htaccess files (1) UNLESS an htaccess file exists in
> that particular subdirectory (2). Should an htaccess file exist, then,
> unless instructed through "RewriteOptions inherit", only the instructions
> contained within that htaccess file apply from that directory (2) onward (3,
> and so on down).

Not quite.  Configuration directives are *always* merged with those
from parent directories.  The only exception is mod_rewrite.  For
mod_rewrite, directives are only inherited if the RewriteOptions
inherit is set.

> My questions follow:
> 
> 1. Put .htaccess in user's home directory?:
> Is it good practice to put an .htaccess file in a user's home directory?(0).
> Would/Do you do this? Why or Why not? Is this a practice anywhere? Can you
> provide an example?

This depends entirely on what you are attempting to accomplish. 
.htaccess files can do many different things.  You should probably
start by reading
http://httpd.apache.org/docs-2.0/howto/htaccess.html

> 2. Searching for .htaccess:
> How many directories up are searched if a htaccess file is not found in the
> current directory and the parent directory?

.htaccess files are checked all the way up to the filesystem root,
unless the AllowOveride option has been set to "none" (as it is in the
default config file).

The rest of your question doesn't make much sense once you correct the
mistakes above.  If you need more detail, it would probably be helpful
to explain exactly what you are trying to accomplish, rather than
talking in the abstract.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message