Forum Moderators: phranque

Message Too Old, No Replies

301 Permanent + friendly message

         

millyre

12:18 pm on Apr 20, 2006 (gmt 0)

10+ Year Member



Hi all,

I'm about to move a site, and am planning to use 301 permanent redirects to preserve pagerank etc.

Is it possible to combine 301 redirects (by means of .htaccess) with a friendly transitory page - 5 sec -explaining to the visitor the change of name and URL?

I was thinking about using rewrites on the new site serving a custom page, based on referrer, with a meta redirect to the new page after a number of seconds, but I'm not sure if this can be achieved with .htaccess alone.

Tips?

hakre

10:33 am on Apr 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi millyre,

the redirect is handled by the client (user agent), so there are 2(3) cases:

1.) the client supports the protocol
2.) the client does not support the protocol
(3.) the clients protocol implementation is broken (see 2.))

so if the client supports the protocol (and that's what you assume because you're using the protocol), it does whatever a client should do:

If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.
(Source: rfc 2616 Section 10.3.2 301 Moved Permanently)

which means that if you put the status code and the new location into the BODY (that's other than GET or HEAD), you have chance that the rest of the BODY is displayed within the browser but it can be redirect automatically and it won't be displayed at all.

to put the redirect into the BODY a META-TAG within a HTML document might do the job, i don't know the correct definition/rfc for the client of this. As far as i am aware of, a

<META HTTP-EQUIV="name" CONTENT="content">
should do the job. but please check with the user-agents you want to have this all working with.

name should be replaced with the name of HTTP header you want to use and content with the value of the header.

give it a try and post your feedback.

millyre

11:50 pm on Apr 21, 2006 (gmt 0)

10+ Year Member



Hi, thanks a lot!

Are you thinking of something like this

<html>
<head>
<title>Mysite</title>
<meta http-equiv="Status" content="301 Moved Permanently" />
<meta http-equiv="Location" content="http://www.mynewsite.com/" />
</head>
<body>
Hi! We've moved
<a href="http://www.mynewsite.com/">here</a>
</body>
</html>

Shows up like an ordinary web page in all browsers I've tried so far, but it gives an initial status 200 to everyone I assume..?

hakre

9:39 am on Apr 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi millyre,

that's exactly what I was talking about. But: you can check this for the different browsers but what does google think about this? Is this a real 301 which is able to preserve pagerank? Maybe the google forum holds some info about this, because the google website is pointing to rfc 2616 I was talking about above - the one with "must not".

Whenever I needed to preserve ranking, I used an ordinary 301 (apache or php based) and showed some info on the new page about the changings with the site. for example, a month before switch we put a banner on the page that siteA.com will be siteB.com in the furture, then we switched over and it took about some time until the serps reflected the changes and the banner stood on top all the time until this phase was over. Worked like a charm, no complaints by site users or search engines.

--hakre

millyre

8:51 pm on Apr 28, 2006 (gmt 0)

10+ Year Member



Hi hakre!
It is a quite interesting solution, although it feels a bit like a hack :-)

It'll be interesting to see how it affects our pagerank (we never had much of it anyway).

Perhaps the next time I'll plan things ahead, and use the more common approach with .htaccess...