tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Redirecting a port to a webapp
Date Tue, 24 Nov 2009 12:47:13 GMT
Peter Crowther wrote:
> 2009/11/24 Looijmans, Mike <>
>> Because the "xxxx" is a random word, not a
>> constant, nor the name of a servlet. Think wikipedia, the request might
>> be for /foo or /bar or whatever, and the servlet uses that word for its
>> own purposes (it will look it up in the database and return something
>> interesting).
> Aha!  New information - thank you!  I don't think you'd previously
> mentioned that the xxxx was dynamic, not static.

Thanks for pointing that out. ;-)

> I'd expect urlrewrite should be able to handle this situation - as
> would writing your own Filter if you want to learn about the
> technology.  Urlrewrite's manual is remarkably clear; I suspect it
> would save time overall.
> If you install urlrewrite, I'd expect a urlrewrite rule similar to the
> following to work (note: untested!)
> <rule>
>   <note>Redirect :666/anything to :80/myapp/anything</note>
>   <condition name="port">666</condition>
>   <from>^\(.*\)$</from>
>   <to>/myapp/$1</to>
> </rule>
> That plus two connectors for the two ports should do it, I think.
I think so too.  My personal doubt is still about how Tomcat would try 
map a request that comes in as "/xxxx", "xxxx" being variable and being 
NOT "myapp".  Since it does not find a match with "/myapp", and since 
obviously there cannot be an infinity of "/webapps/xxxx" apps 
pre-configured, would it then pass it to the "default app" (/ROOT) ?
Because then, that's where the filter would need to be configured, no ?

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

View raw message