Search Engines and 301 Permanent Redirects
By elving on Apr 03, 2006
elcafe points out that 302 redirects can have an adverse impact on search engine rankings.
(The HTTP/1.1 specification defines a number of different types of redirects. The two most common are 301 Moved Permanently and 302 Moved Temporarily. Because they can't know what the future holds -- that is, whether the redirect will be in place until the universe ends -- web servers usually generate 302 Moved Temporarily responses.)
Sun Java System Web Server (like Sun ONE Web Server, iPlanet Web Server, and Netscape Enterprise Server before it) allows the administrator to configure redirects, but it always generates 302 temporary redirect responses. Fortunately, beginning with Sun ONE Web Server 6.1, it's possible to force Web Server to use 301 permanent redirects. After adding your
NameTrans fn="redirect" directive to obj.conf or configuring URL Forwarding in the Content Mgmt tab of the Virtual Server Class Manager, add the following below the
<Object name="default"> line in the obj.conf configuration file:
<Client code="302"> Output fn="set-variable" error="301" noaction="true" </Client>
The above will cause Web Server to return 301 permanent redirect responses for all redirects. If you only want to use 301 permanent redirect responses for certain URIs, you can instead add the following to the bottom of obj.conf:
<Object ppath="path"> <Client code="302"> Output fn="set-variable" error="301" noaction="true" </Client> </Object>
"path" is the wildcard pattern for which you wish to configure 301 redirects, e.g. "/redirects/\*", "/directory", or "\*.jsp".