views:

48

answers:

1

Hi,

how, if possible, can I redirect a request for a hostname to a specific subdirectory of one of the deployed apps?

E.g., I wish to forward

http://host.com 

to

http://host.com/app/path

It is however possible to redirect to a specific application on tomcat, e.g.,

    <Host name="host.com" appBase="webapps">
        <Context path="/" docBase="webapps/app" debug="6"/>
    </Host>

But I've never managed to redirect it to a subpath of an application. I'd fancy a tomcat-only approach over using an external mod_proxy with apache2 to achieve this.

A: 

This worked for me by changing path to "" (i.e. making it default web app for the Host)

<Host name="host.com" appBase="webapps">
            <Context path="" docBase="webapps/app" debug="6"/>
        </Host>

It serves static files correctly, but my JSTL fails now.

Anyways, can you try?

JoseK
hmm, to me, both approaches seem to have the same impact. That is, it allows me to associate "host.com" with "host.com/app", but not with "host.com/app/path".
Johan Sjöberg