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 trying to redirect all the traffic from .se to .com but for some reason the VirtualHost ignores the ServerName and ServerAlias that I define.

<VirtualHost *:80>
    Redirect 301 /

In the above example all the traffic will go through the VirtualHost redirect even though the tld is not .se

Am I missing something?

share|improve this question
up vote 5 down vote accepted

Short answer: Yes.

Long answer: It sounds like this is your first VirtualHost in the configuration file, which makes this the primary virtual host. It means that your other virtual hosts aren't specific enough to match the traffic, causing them to land in this virtual host instead.

Refer to the following page:

In particular:

Main host goes away

If you are adding virtual hosts to an existing web server, you must also create a block for the existing host. The ServerName and DocumentRoot included in this virtual host should be the same as the global ServerName and DocumentRoot. List this virtual host first in the configuration file so that it will act as the default host.

share|improve this answer
wow how fast to respond! and I was beginning a philosophical answer extra large :) +1 – RTOSkit Jan 8 '13 at 1:00
haha, I worked with httpd pretty constantly for a few years so I'm like a robot now. Maybe my avatar is a little too appropriate... – Andrew B Jan 8 '13 at 1:04

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.