All,
I am redirecting some urls with specific query strings to new page . For example http://testserver.xyz.com/abc/content/content.jsp?contentId=123
or http://testserver.xyz.com/abc/content/content.jsp?contentId=345
needs to be redirected to http://ww2.newtestserver.com/xyz.html
For this purpose i wrote following redirects:
RewriteCond %{QUERY_STRING} contentId=123 [OR]
RewriteCond %{QUERY_STRING} contentId=345 [OR]
RewriteCond %{QUERY_STRING} contentId=678
RewriteRule ^/(.*)$ http://ww2.newtestserver.com/xyz.html/? [R=301,L]
This works fine except when i type in my browser http://testserver.xyz.com/abc/content/content.jsp?contentId=1234
. This also gets redirected to http://ww2.newtestserver.com/xyz.html
.
I do not want this. how can i prevent this so that my mod rewrite only looks at query string 123 or 345 or 567 but not something 123x or 345x or 678x?
Please help
TIA