Search Engines and 301 Permanent Redirects

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>

Where "path" is the wildcard pattern for which you wish to configure 301 redirects, e.g. "/redirects/\*", "/directory", or "\*.jsp".

Comments:

Hi, We host a big site and have multiple URI's to be redirected. What should be the best way to redirect the sites? Thanks in advance.

Posted by Michael on January 22, 2007 at 02:50 AM PST #

Can you share more details about the redirects you want to do (i.e. redirect from what URIs to what URIs)? There are a few different ways to configure redirects, and the "best" way will depend on the type of redirect.

Posted by Chris Elving on January 22, 2007 at 03:03 AM PST #

Hi, currently i'm using sunone web server to proxy request from weblogic server(jsp files). I want it to be a permanent redirect sample from host1.sample.com to host2.sample.com but under host2, there are links to other hosts.

Posted by Michael on January 22, 2007 at 05:38 AM PST #

If host1.sample.com and host2.sample.com share an obj.conf configuration file, it's simple to send a 301 redirect in response to any request that doesn't specify host2.sample.com in the URL:

<If $urlhost ne "host2.sample.com">
NameTrans fn="redirect" from="/" url="http://host2.sample.com/" status="301"
</If>

You should add this NameTrans directive immediately above the first NameTrans directive in your obj.conf configuration file.

I'm not sure I understand what you mean by "links to other hosts", though, so this might not be exactly what you're looking for...

Posted by Chris Elving on January 22, 2007 at 06:50 AM PST #

Hi, hosts2 is the permanent site and within hosts2 there are links which points to other hostnames like hosts3, hosts4...hostsX will also require permanent redirection. And will the search engine rankings be the same if we do a permanent redirect?

Posted by Michael on January 23, 2007 at 12:52 AM PST #

Hi, How do I define $urlhost in obj.conf? Thanks.

Posted by Michael on January 23, 2007 at 04:08 AM PST #

$urlhost is a predefined variable. The server automatically sets it to the hostname from the URL the client requested.

Posted by Chris Elving on January 23, 2007 at 07:06 AM PST #

Hi, Inserted the config above but returned this error: failure: CORE3185: Invalid configuration: File /opt/SUNWwbsvr/https-sunone.mminteractive.com/config/server.xml, line 25, column 50: HTTP3258: Error processing obj.conf line 3: HTTP2211: unknown container directive Failure

Posted by Michael on January 24, 2007 at 02:13 AM PST #

Hi, Inserted the config above but returned this error: failure: CORE3185: Invalid configuration: File /opt/SUNWwbsvr/https-sunone.mminteractive.com/config/server.xml, line 25, column 50: HTTP3258: Error processing obj.conf line 3: HTTP2211: unknown container directive Failure

Posted by Michael on January 24, 2007 at 06:22 AM PST #

I have Sun One Web Server 6.1SP3...I have a php script that reads the referrals and would like everything in
.../DIR1/ to be redirected to /NEWDIR/index.php .. currently in my obj.conf i have
<Object ppath=".../DIR1/\*">
NameTrans fn="redirect" from="/" url="http://www.foo.com/NEWDIR/index.php"
</Object>

my question is how do I achieve this since the referral is not getting passed along .. in the logs i have

"GET /DIR1/foo HTTP/1.1" 300 0 "-"

thanks

Posted by Jamal Miles on August 16, 2007 at 12:59 AM PDT #

good

Posted by guest on October 02, 2007 at 03:15 AM PDT #

Hi, we are currently getting 302>>301>>200 status for one of our projects using Iplanet webserver 4.1 version. Can anybody let me know the impact on Page Ranking of getting 302 as the first status and then 301??

Posted by Jay on October 18, 2007 at 03:40 AM PDT #

Is there anyway to set a 301 redirect on iPlanet 6.0? I know it's not supported and automatically sets it to 302...but is the anyway at all to get it to set a 301?

Posted by Michelle on October 19, 2007 at 11:19 AM PDT #

im using Sun ONE web server 6.1 and i need to implement a permanent redirect 301, i tried your syntax as below and its working... can you please help me on this

Object ppath="/\*">
<Client code="302">
Output fn="set-variable" error="301" noaction="true"
NameTrans fn="redirect" from="/" url="NewURL"
</Client>
</Object>

Posted by Prem Kumar on December 16, 2008 at 03:51 AM PST #

Sorry for the typo mistake its currently 'not' working

Posted by guest on December 16, 2008 at 03:52 AM PST #

Is there anyway to set a 301 redirect on iPlanet 6.0? I know it's not supported and automatically sets it to 302...but is the anyway at all to get it to set a 301?

Please reply me ASAP because it is any very urgent issue.

Posted by Divvela on June 02, 2009 at 03:49 AM PDT #

I have 5000 Meta redirects on my website. Now i want to remove al lthe meta redirects and put them in single file.

This is very much possible in apache by using a htaccess file and put the required mapping for a dir VS url where it needs to go.

But in sun one htaccess is more or less take only access related parameters. So is there any way that i can put all these 5000 Meta redirects in a single file so that is easy for me to manage without restarting the web server.

It is sun one 6.1 SP4

Thanks
Singh

Posted by Rajwinder Makkar on June 10, 2009 at 11:58 AM PDT #

I want redirect from es.domain.com to www.domain.es with 301 redirect.

i am trying

NameTrans fn="redirect" from="http://es.domain.com" url="http://www.domain.es"

And then, to the bottom

<Client code="302">
Output fn="set-variable" error="301" noaction="true"
</Client>

iPlanet 6.1

Server doesnt redirect ¿Why?

Posted by kokodrilo on June 18, 2009 at 06:08 AM PDT #

redirections works fine.

But now . . . I use a cdn . . .

What is the impact on redirects?
Could it be a problem ?

Posted by kokodrilo on June 22, 2009 at 06:14 PM PDT #

I'd like to set up a redirect of a directory. For example:

NameTrans fn="redirect" from="/imma" url-prefix="/imma_info.jsp"

or

NameTrans fn="redirect" from="/biz/tm" url-prefix="/biz/tm_intro.html"

The problem is that the this puts the browser in a loop and I get a redirection limit notification from the browser and the redirect fails.

How can I accomplish a 301 redirect of directories to a page with the same prefix? Any help would be greatly appreciated.

Posted by Nicole on July 30, 2009 at 07:31 AM PDT #

Hi,

I want to redirect domain to domain with 301. Can any body help me the below one,

www.xyz.com should redirect to www.abc.com with 301

i am using iplanet 6.1

I have created separate virtual server and created a index.html with meta tag but that meta refresh don't want to me.

Is there any way to achieve this. Please suggest me. It is very urgent requirement.

Regards,
Divvela

Posted by Divvela on September 03, 2009 at 08:48 AM PDT #

We have a large site (2000 pages) that need 301 redirects to 2000 other pages (all combinations).

We do not want to include the config in the obj, but would want to load an external file containing the mappings. Is there a recommended way to do that?

Posted by Damo on October 26, 2010 at 02:40 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

elving

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today