Sun Java System Web Server - Redirects That Include A Query String

If you have three old URIs for which you wish to return 301 redirects back to the client like the following:

And you would like them to respectively send redirects to these URIs:

Then you would need to added the following rules to the obj.conf file:

<If defined $query and $query =~ "type=(.*)" >
NameTrans fn="redirect" uri="$urlhost/page$1.jsp"


This will catch any query string contains type=VALUE and redirect that to host/pageVALUE.jsp . This allows you to have just one if stanza rather than requiring a new if stanza for each possible match (which, while it works, can quickly grow into a nightmare for a sysadmin to have to manage).