Caldarale, Charles R wrote:
> 
> You can use Tuckey's URL rewrite filter (http://tuckey.org/urlrewrite/) or
> you could use virtual hosts: instead of the <Alias>, define a second
> <Host> with an appBase pointing to the desired directory.
>  - Chuck
> 

Chuck, thanks a lot!
1)  I didnt manage to get the second host working, tomcat just won't find
any pages/resources and returns empty pages. Adding context element        
<Context path="" docBase="\ROOT\w1" reloadable="true"/>  seems to fix that
problem, but in this case it looks like it's working in separate context
(none of the java classes from WEB-INF/classes can be used)
2) Tuckey's URL rewrite  does work! But I'm not sure about performance
overheads, compared to using Apache WebServer with Virtual Hosts.
For those who concern, here is the sample rule (from urlrewrite.xml)
    <rule>
        <note>
            subdomains redirect
        </note>
        <condition name="w1.localhost" operator="equal"
type="server-name">w1.localhost</condition>
        <condition name="admin" operator="notequal"
type="request-uri">/admin/(.*)</condition>
        <condition name="w1 cyclic redirection" operator="notequal"
type="request-uri">/w1/(.*)</condition>
        <from>^/(.*)</from>
        <to>/w1/$1</to>
    </rule>


-- 
View this message in context: 
http://www.nabble.com/Tomcat6-map-subdomain-to-particular-directory-under-web-root-tp18531402p18536559.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to