0

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
  </Location>

</VirtualHost>

2 Answers2

0

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

Matias Dominoni
  • 337
  • 1
  • 4
0

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

Richard
  • 166
  • 2