You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by nillehammer <ta...@winfonet.eu> on 2008/10/20 22:05:38 UTC

T5 Handling invalid urls with redirects

Hi List,
Long time no see. I have finally got my application online and am facing
two problems, I have not thought of before. Both of which are users or
search bots (namely google) using wrong urls.

1.) I have got an index Page in the root which works fine, but my
beloved users tend to type "index.jsp" or "index.html" instead of just
index into the address bar of their browser. (Maybe it's because they're
mainly Germans and therefore are hyper correct;-)) ) The dot being used
Tapestry interprets those as components on the index page with ids "jsp"
and "html" and shows my nicely crafted ExceptionReport. I'd rather have
Tapestry send a redirect to the correct url. How can this be
accomplished? I have thought of implementing components with names "jsp"
and "html" and writing event handlers for them but that seems a bit odd
to me.

2.) Before the migration to Tapestry the application was struts based.
Therefore all the URLs within the application have changed. That would
not be a problem, but google keeps the old URLs. I think the reason is
that when a completely wrong URL is typed in Tapestry will directly
response with the index page rather than redirecting to it. So the
client-software never gets informed about the incorrectness. Also in
this case I would like Tapestry to do a redirect. How can this be done?

Your help will be apreciated. Yours nillehammer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 Handling invalid urls with redirects

Posted by Martin Strand <do...@gmail.com>.
We switched from PHP to Tapestry last year and I'm using a rewrite filter  
to redirect old urls to the new ones:

http://tuckey.org/urlrewrite/

Martin

On Mon, 20 Oct 2008 22:05:38 +0200, nillehammer  
<ta...@winfonet.eu> wrote:

> Hi List,
> Long time no see. I have finally got my application online and am facing
> two problems, I have not thought of before. Both of which are users or
> search bots (namely google) using wrong urls.
>
> 1.) I have got an index Page in the root which works fine, but my
> beloved users tend to type "index.jsp" or "index.html" instead of just
> index into the address bar of their browser. (Maybe it's because they're
> mainly Germans and therefore are hyper correct;-)) ) The dot being used
> Tapestry interprets those as components on the index page with ids "jsp"
> and "html" and shows my nicely crafted ExceptionReport. I'd rather have
> Tapestry send a redirect to the correct url. How can this be
> accomplished? I have thought of implementing components with names "jsp"
> and "html" and writing event handlers for them but that seems a bit odd
> to me.
>
> 2.) Before the migration to Tapestry the application was struts based.
> Therefore all the URLs within the application have changed. That would
> not be a problem, but google keeps the old URLs. I think the reason is
> that when a completely wrong URL is typed in Tapestry will directly
> response with the index page rather than redirecting to it. So the
> client-software never gets informed about the incorrectness. Also in
> this case I would like Tapestry to do a redirect. How can this be done?
>
> Your help will be apreciated. Yours nillehammer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org