I am using org.tuckey.web.filters.urlrewrite.UrlRewriteFilter on my java project.It works fine .My issue is it change the existing url.
example i need to redirect mainurl/news/cricket to mainurl/news.jsp/id=2
myurlrewriter.xml
<rule>
<note>
The rule means that requests to /test/status/ will be redirected to /rewrite-status
the url will be rewritten.
</note>
<from>/news/cricket</from>
<to type="redirect">%{context-path}/news.jsp/id=2</to>
</rule>
It redirect the entire url to news.jsp/id=2 but i dont want to change the url ,only change the contents, is it possible?anybody knows how do it.
Help is highly appreciated.
Thanks,
VKS.
Then don’t use a redirect. It will send a 302, which means it’s telling the browser that the page has moved. Just lose the
type="redirect":