Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to setup a subdomain on a server of mine, where serves the content from

Perhaps this is the wrong way of doing this entirely, but I have setup a VirtualHost for this, whose DocumentRoot is / However, it seems that the .htaccess file from the original DocumentRoot (i.e. / is still being applied even under the new subdomain's VirtualHost.

So, I'm wondering, does Apache look at .htaccess files, even if they're above the DocumentRoot — if so, how can I stop it from doing this (it's rewriting the URL and sending it to somewhere that I don't want it to go)? Or if there's a better way of doing this, I accept that I might be being a complete idiot and doing it totally wrong :)


share|improve this question
up vote 2 down vote accepted

I suggest you look at the .htaccess files tutorial in the Apache documentation to get an idea of how they are applied.

Basically Apache will walk up the directory tree looking for htaccess files unless you have an AllowOverride None directive in a <Directory> statement.

Edit: Apache will keep going till it hits an AllowOverride None directive for a directory. Most servers come configured with it set for / and whatever the default server root is. This keeps the default configuration from traversing past your web root. However, the default is also None, so I think this must be for clarification purposes only. I suggest you check your default /etc/apache2/httpd.conf file to be sure.

share|improve this answer
I did see that, but it doesn't mention where (or if) it stops… will it traverse right up to the root directory? – obeattie Nov 10 '09 at 14:06
…by which I mean /, not the DocumentRoot. – obeattie Nov 10 '09 at 14:07
Added some clarification regarding the traversal. – Kamil Kisiel Nov 10 '09 at 17:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.