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'm not sure when, but suddenly subdomains aren't working on my server.

e.g. works, but isn't working.



        DocumentRoot /var/www/lawson/david
        <Directory /var/www/lawson/david/>
                Options -Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all

        ErrorLog /var/log/apache2/lawson/david/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/lawson/david/access.log combined


Any suggestions on how to debug this further, or what the problem might be?

share|improve this question
up vote 1 down vote accepted

Your Apache server seems to be doing a 301 redirect to which doesn't exist in DNS. Have you added anything to the .htaccess or the site code which would redirect to www.$HOSTNAME?

share|improve this answer
RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ %{HTTP_HOST}/$1 [R=301,L] can I change these to allow specific subdomains? – David Lawson Jan 5 '11 at 11:50
You can enter multiple rewrite conditions before the RewriteRule. So for example add: "RewriteCond %{HTTP_HOST} !^david\.lawson\.co$" before the first RewriteCond, and the RewriteRule will only trigger if the host is not AND it does not start with www. – Niall Donegan Jan 5 '11 at 12:02
!^(www|david)\. – David Lawson Jan 5 '11 at 12:03
thank you so much! :) wish I could + – David Lawson Jan 5 '11 at 12:03

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.