Search This Blog

Wednesday, November 22, 2006

How to redirect to an URL with out the quesry string

When ever you want to access the URL

/j2ee/examples/jsp/num/numguess.jsp?guess=500 you want to redirect to http://indl224ad.idc.oracle.com:7777/j2ee/examples/jsp/jsp2/el/basic-arithmetic.jsp
without the query string parameters

RewriteEngine on
RewriteLog "c:\rewrite.log"
RewriteLogLevel 9
RewriteCond "%{REQUEST_URI}" "/j2ee/examples/jsp/num/numguess.jsp"
RewriteCond "%{QUERY_STRING}" "^guess=500"
RewriteRule ^/(.*) http://indl224ad.idc.oracle.com:7777/j2ee/examples/jsp/jsp2/el/basic-arithmetic.jsp? [L,R=permanent]

No comments: