Java Mailing List Archive

http://www.junlu.com/

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

Re: SV: URL-rewriting

srevilak

2003-12-30

Replies:

mattias.bogeblad> Hi All,
mattias.bogeblad>
mattias.bogeblad> I want to be able to use url-rewriting in an
mattias.bogeblad> application I have. I want to transform urls like
mattias.bogeblad> http://localhost:8080/infoglueDeliver/products/productX.html
mattias.bogeblad> to
mattias.bogeblad> http://localhost:8080/infoglueDeliverDev/ViewPage.action?navigationTitle=products/productX.html

As far as mod rewrite goes, something like this should work.

RewriteEngine One
RewriteOptions inherit
# RewriteLog logs/mod_rewrite_log
# RewriteLogLevel 2
RewriteRule ^/infoglueDeliver/(.+) /infoglueDeliverDev/ViewPage.action?navigationTitle=$1 [PT]

The above assumes that "/infoglueDeliver/" will always be followed by
some other url element.

RewriteLog and RewriteLogLevel can be used as needed for debugging.

Finally, the apache module that connects to tomcat should appear _before_
mod_rewrite in the LoadModule order.

hth.

--
Steve

---------------------------------------------------------------------
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.