PDA

View Full Version : .htaccess inheritance?


Chen
Thu 27th Dec '01, 7:05am
I was just wondering, what happens if I have a .htaccess file in the /htdocs folder, and then another one in the /htdocs/admin folder.
The one in /htdocs only has this thing to redirect 404 messages, and the one in /htdocs/admin[/color] has access restriction with its own .htpasswd file.

Now, what happens if a 404 occurs under the /htdocs/admin folder?
Will it do what the /htdocs .htaccess file says, or will it just show you the regular 404 page?

I didn't test this yet, I'm just wondering what will happen.
Basically my question is, if there is a .htaccess file in a child folder, and it doesn't have a setting that the father's .htaccess file has, will it use the father's setting?

Thanks. :)

eva2000
Thu 27th Dec '01, 7:23am
http://apache-server.com/tutorials/ATusing-htaccess.html


So What's an .htaccess File?
An .htaccess file is simply a text file containing Apache directives. Those directives apply to the documents in the directory where the .htaccess file is located, and to all subdirectories under it as well. Other .htaccess files in subdirectories may change or nullify the effects of those in parent directories; see the section on merging (http://apache-server.com/tutorials/ATusing-htaccess.html#merging) for more information.

Chen
Thu 27th Dec '01, 7:55am
Couldn't ask for more. :)
Thanks a lot eva. :)

eva2000
Thu 27th Dec '01, 8:36am
Originally posted by FireFly
Couldn't ask for more. :)
Thanks a lot eva. :) no probs ... learnt something new as well from it :D