Tomcat6 map subdomain to particular directory under web root
server.xml Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Aliasw1.localhost/Alias /Host Using alias w1.localhost maps subdomain to web root directory Is there any trick to map w1.localhost to localhost/w1 directory? -- View this message in context: http://www.nabble.com/Tomcat6-map-subdomain-to-particular-directory-under-web-root-tp18531402p18531402.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]
RE: Tomcat6 map subdomain to particular directory under web root
From: kazukin6 [mailto:[EMAIL PROTECTED] Subject: Tomcat6 map subdomain to particular directory under web root server.xml Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Aliasw1.localhost/Alias /Host Using alias w1.localhost maps subdomain to web root directory Is there any trick to map w1.localhost to localhost/w1 directory? 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 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat6 map subdomain to particular directory under web root
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-namew1.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]