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 have a subdomain:

my .conf file looks like:

<VirtualHost *:80>
    DocumentRoot /var/www/html/my/

    <Directory /var/www/html/my/ >
        Options FollowSymLinks
        AllowOverride All



If I go to h**p:// I see the file. That's good.

If I go to h**p:// I see the file as well.

How can I prevent the 2nd option from not seeing the file, while allowing the 1st option to see it?

share|improve this question

Create a default <VirtualHost> which catches any hostname which hasn't been set up explicitly.

See An In-Depth Discussion of Virtual Host Matching for details.

share|improve this answer
This is perfect reading for my learning process -- thank you! – user48886 Jul 21 '10 at 15:10

Unless you want the /my/ to be available under the parent domain, you need to give your subdomain VirtualHost a completely separate DocumentRoot. I take it that /var/www/html/ is the DocumentRoot for the parent VirtualHost? If so, try using something like /var/www/my/ as the subdomain DocumentRoot.

share|improve this answer
And this perfectly solved my issue! Thanks... – user48886 Jul 21 '10 at 15:11

Your Answer


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