Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

URL Internal Redirect works with Tomcat/Apache 1.3 but not with
Apache 2.0

Raiden

2004-02-18

Replies:

Hello,

I use Tomcat 4.1.27 and Apache 1.3.

I want a request to mywebsite.com/123456 to be mapped to
mywebsite.com/website/index.jsp?id=123456

In Apache 1.3 with Tomcat, I accomplished this with the following rewrite
rule:
RewriteRule ^/([0-9]+)/?$ /website/index.jsp?id=$1 [P]

However, this rule does not seem to be working with the Apache 2.0 series
and Tomcat. I get a 404 error that the page cannot be found. The only
way that I can get this rule to even come close, is by using the
following:
RewriteRule ^/([0-9]+)/?$ http://www.mywebsite.com/website/index.jsp?id=$1
[L,R]

This of course forces it to do an external redirect, and requires another
request from the client, and ends up rewriting the URL in the client's
browser.

Does anyone know how to make the first rule work as an internal
server-side redirect with Apache 2.0 and Tomcat, so that the client only
has to make one request, and the true page is hidden from them?

Thanks!
-Raiden Johnson


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.