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.
Trackback URL: http://blogs.sun.com/elving/entry/301_permanent_redirects_in_7
Posted by Antonio on February 13, 2007 at 08:34 AM PST #
Yeah, unfortunately it looks like the redirect status parameter was broken in the initial release of Web Server 7.0. The good news is that it appears to be fixed in 7.0 Update 1. You can download a preview release of 7.0U1 at http://www.sun.com/download/products.xml?id=45ed9ff1.
Posted by Chris Elving on March 19, 2007 at 02:14 PM PDT #