Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a site example.com and another one test.example.com. Both have different configuration file. But when I enter url test.example.com it will redirect to example.com.

configuration file for example.com

 <VirtualHost *:80>
  ServerName  example.com
  ServerAlias www.example.com

  DirectoryIndex index.html
  DocumentRoot my-document-path

  Options -Indexes

  ErrorDocument 404 /errors/404.html
  ErrorDocument 403 /errors/404.html

 <Location "/">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    PythonPath "['path', 'path'] + sys.path"
    SetEnv DJANGO_SETTINGS_MODULE example.settings
    PythonInterpreter example
    PythonAutoReload On
    PythonDebug On

share|improve this question

2 Answers 2

I had this problem a few times, having multiple domain names defined, apache will load the first one.
Did you define NameVirtualHost? Take a look at this reference: NameVirtualHost Directive

share|improve this answer

Creating a named virtual host will resolve the issue for you as above :)

share|improve this answer

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.