On Wed, 30 Nov 2005, Jorey Bump wrote:

Nicolas Lehuen wrote:

2) Server name

Thanks to Daniel's excellent posts, I can see that req.hostname is the best way to get the server name so far. Unfortunately, it depends on data sent by the client, but hey, so does the rest of the request handling ;).

req.server.server_hostname is unambiguous, and I can't think of a real-world situation in which it would be None. It matches the ServerName in your Apache configuration, so won't this be a reliable value to use when reconstructing an URL?

To add just a tad more confusion here - don't forget ServerAlias, which is also a perfectly valid value for the "deduced" URL. ;-)

Grisha

Reply via email to