You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by daniel polonsky <da...@gmail.com> on 2010/07/04 17:22:09 UTC

Rewrite context part in URL

>
> Hi guys
>
> How can I configure tomcat 6.0 to rewrite the context part of URL so a
> range of contexts will be mapped to one context.
>
> e.g.
> http://localhost:8080/WEBAPP/
> http://localhost:8080/webapp/
> ...
>
> will all be mapped to
>
> http://localhost:8080/WebApp/
>
> Note that i don't won't to use caseSensitive attribute on context as it is
> Deprecated and has some security problems.
>
>
> thanks a lot
>

Re: Rewrite context part in URL

Posted by daniel polonsky <da...@gmail.com>.
It sounds great, I will just add tuckey filter in root web app and do
whatever redirection needed there.
thanks a lot :)

On Sun, Jul 4, 2010 at 8:29 PM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: daniel polonsky [mailto:danpolonsky@gmail.com]
> > Subject: Re: Rewrite context part in URL
> >
> > As far as I understand tuckey can't help me in rewriting the
> > application directory (context), but rather the rest of url
> > following the context.
>
> Not my understanding.  You'll need to have the filter in the ROOT webapp,
> since that's where Tomcat will send requests that aren't satisfied by an
> explicit request.  At that point, the URL rewrite filter can modify the
> request any way you want, and either forward or redirect to the proper URL.
>  (I would think redirect in your case, so the proper URL will be used in
> subsequent requests by the client.  If you choose to use forward, you'll
> need to enable the cross-context attribute for ROOT in its <Context>
> element.)
>
>  - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: Rewrite context part in URL

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: daniel polonsky [mailto:danpolonsky@gmail.com]
> Subject: Re: Rewrite context part in URL
> 
> As far as I understand tuckey can't help me in rewriting the
> application directory (context), but rather the rest of url
> following the context.

Not my understanding.  You'll need to have the filter in the ROOT webapp, since that's where Tomcat will send requests that aren't satisfied by an explicit request.  At that point, the URL rewrite filter can modify the request any way you want, and either forward or redirect to the proper URL.  (I would think redirect in your case, so the proper URL will be used in subsequent requests by the client.  If you choose to use forward, you'll need to enable the cross-context attribute for ROOT in its <Context> element.)

 - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Rewrite context part in URL

Posted by daniel polonsky <da...@gmail.com>.
thanks for your reply !
I have downloaded it earlier today :)
As far as I understand tuckey can't help me in rewriting the application
directory (context),
but rather the rest of url following the context.

thx
Daniel

On Sun, Jul 4, 2010 at 6:40 PM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: daniel polonsky [mailto:danpolonsky@gmail.com]
> > Subject: Rewrite context part in URL
> >
> > How can I configure tomcat 6.0 to rewrite the context
> > part of URL so a range of contexts will be mapped to
> > one context.
>
> You can't configure Tomcat directly, but you can use this filter:
> http://www.tuckey.org/urlrewrite/
>
>  - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: Rewrite context part in URL

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: daniel polonsky [mailto:danpolonsky@gmail.com]
> Subject: Rewrite context part in URL
> 
> How can I configure tomcat 6.0 to rewrite the context 
> part of URL so a range of contexts will be mapped to 
> one context.

You can't configure Tomcat directly, but you can use this filter:
http://www.tuckey.org/urlrewrite/

 - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org