301 Permanent Redirects in Web Server 7
By elving on May 19, 2006
A while back, I mentioned how to configure 301 permanent redirects in Sun ONE Web Server 6.1. I just thought I'd mention that it's even easier in Sun Java System Web Server 7. By default, Web Server creates directives like the following in the obj.conf configuration file:
NameTrans fn="redirect" from="/path" url="http://server.example.com"
The above configures a 302 Moved Temporarily redirect. Starting in Web Server 7, you can add a
status="301" parameter to indicate you want a 301 Moved Permanently redirect instead:
NameTrans fn="redirect" from="/path" url="http://server.example.com" status="301"
It's that easy. The Sun Java System Web Server 7 Technology Preview is out now, and it's free.