[mod_python] Getting Hostname

g.farina at pharaondev.com g.farina at pharaondev.com
Wed Nov 15 13:05:45 EST 2006


in my simple MVC framework I'd like to use a different directory root for
controllers based on the website requested by the user.
For instance if someone connects to www.test.it/first I'd like to use
/var/www/test as controllers root, and if someone connects to
www.test2.it/first use /var/www/test2.

I didn't have enought knowledge of how Apache works, so I don't know if
the value of req.server.server_hostname is reliable to do the switch of
the root.
The solution used should work indipendently from Apache configuration, and
I don't want to rely on headers sent by the client.

The directory switching should be configured from the application, so I
can't use Virtual Hosting or Apache configuration directly.

Any suggestion ?


More information about the Mod_python mailing list