Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have several domains running under apache. Most of theme they do not have yet virtualhost. My problem is that all this not registered domains by apache are getting redireted to the setup domain. How to force apache to accept request just from the domain.

what I mean

<VirtualHost *:80>
        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all

than I have for example, all are redirected to This should be avoided

if I use wildcar like ServerAlias * and I have subdomain than the svn subdomain is going to be redirected to

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Add a default virtualhost, like this:

<VirtualHost _default_:80>
    ServerAlias *
    DocumentRoot /var/www/htdocs
share|improve this answer

You just have to add your domain names in the ServerAlias directive's list an configure each DNS zone to resolve as your Web server.

share|improve this answer
and what about if I have for example for a subdomain ( in this case the wildcard (.*) won't work –  fefe Apr 24 '13 at 20:11
In ServerAlias, you can specify * if this is what you mean. –  Spack Apr 24 '13 at 20:29

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.