tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: canonical hostnames for tomcat server
Date Fri, 12 Jun 2009 14:35:30 GMT
Caldarale, Charles R wrote:
>> From: Mark Shifman []
>> Subject: Re: canonical hostnames for tomcat server
>> host name aliases may help
> I don't think aliases will do it.  Look at virtual hosting in Tomcat:
> Set up an additional <Host> with a name attribute of "" with
an appBase that points to the webapps you want to use with that domain.  Any requests that
do not match that specific domain will be handled by the <Engine>'s defaultHost, which
you can leave as "localhost".
I think the OP not only wants to have the requests handled by the host 
whose name corresponds to the one in the request.
He also wants, if this request hostname is /not/ the canonical one, to /not/ serve the request, but (externally) 
re-direct the browser to the canonical host.
In other words, he wants to "educate" his users.

I suppose you could still do it with 2 <Host> sections, the non-default 
being the canonical one which answers normally, and the default <Host> 
having /something/ inside which returns a 301 (?) redirect for every 
request, to the canonical one.
How would one do this under Tomcat however ?
Create a default servlet which processes all requests and always issues 
a re-direct response ? or is there a simpler solution ?

That's why I was saying that the simplest solutions may well be the ones 
he mentioned at the beginning.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message