Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 47140 invoked from network); 4 Feb 2004 20:27:16 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 Feb 2004 20:27:16 -0000 Received: (qmail 85775 invoked by uid 500); 4 Feb 2004 20:26:22 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 85738 invoked by uid 500); 4 Feb 2004 20:26:22 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 85720 invoked from network); 4 Feb 2004 20:26:21 -0000 Received: from unknown (HELO forty.greenhydrant.com) (208.48.139.185) by daedalus.apache.org with SMTP; 4 Feb 2004 20:26:21 -0000 Received: from www.greenhydrant.com (localhost [127.0.0.1]) by forty.greenhydrant.com (Postfix) with SMTP id B0ABBE38FB for ; Wed, 4 Feb 2004 12:26:26 -0800 (PST) Received: from 208.48.139.163 (SquirrelMail authenticated user drees) by www.greenhydrant.com with HTTP; Wed, 4 Feb 2004 12:26:26 -0800 (PST) Message-ID: <1621.208.48.139.163.1075926386.squirrel@www.greenhydrant.com> In-Reply-To: References: Date: Wed, 4 Feb 2004 12:26:26 -0800 (PST) Subject: Re: mod_jk and virtual folders? From: "David Rees" To: "Tomcat Users List" User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Wed, February 4, 2004 1at 2:02 pm, Tim Diez wrote: > > I'd like to use apache and mod_jk to dynamically re-route all subfolders > of my httpd web server to a single Tomcat webapp. > > http://www.myserver.com/ > http://www.myserver.com:8080/mywebapp > > The tricky part for me has been setting this up to be dynamically > routed. What I'd like to do is have myserver.com/ route to > myserver:8080/mywebapp, so I don't have to create a virtual host for > every potential subfolder on myserver.com:80/ > > So, I need http://www.myserver.com/*/hello.do?param=nada to map to > http://www.myserver.com:8080/mywebapp/hello.do?param=nada > > I need the url to always keep the original host/folder. I tried > mod_rewrite, but it changes the URL after the redirection. If I use > mod_jk any folders off of the default port 80 server have to co-exist as > a webapp under tomcat(as far as I know). You'll have to use mod_rewrite for this, and you'll have to make sure that you're using internal redirects (or forwards) instead of exernal redirects. This will require that you have mod_proxy installed as well. So something like this may work: RewriteEngine on RewriteRule ^/(.*)/(.*)$ http://www.myserver.com:8080/$2 [P,L] What rewrite config did you try before? -Dave --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org