If you have a legacy website running with an old code-base that provides certain functionality. The successor website is ready to go, supplying all of the old functionality and much more. For a while, there's been an HTML link around the old site pointing towards the brand new one, for individuals customers that choose to click over.

Now, the legacy website is reaching its finish of existence, and you need to instantly redirect customers towards the new site, for instance using a 301 or 302 redirect. However, whenever a user encounters this redirect, you need to also display an amiable message around the new site welcoming them and explaining why they aren't seeing that old version.

Once the user clicks an HTML link, the HTTP_REFERER header is populated, and also the welcome message could be triggered via that value. Nevertheless it seems the same isn't true when utilizing 3XX redirect codes.

The very best Google hit with this problem has this to express: "HTTP 1.1 specs states it clearly: if your 3XX code is offered, no Referer value is passed. (eventualy, the URL that pointed to 3XX site)." (http://www.usenet-forums.com/apache-web-server/37811-how-set-referer-redirect.html#post145986)

However couldn't find this statement inside a quick go through the spec (http://tools.ietf.org/html/rfc2616).

Can anybody suggest the best way to accomplish this functionality?

Note: This isn't intended to be an exciting-encompassing solution. We realize that some clients don't even send the HTTP_REFERER header for privacy reasons, but with regard to argument, let us ignore which use situation.

First, This ought to be a 301, not really a 302 redirect. Your redirection is permanent, would you like to indicate that. Regarding how you can indicate the redirect, just give a parm towards the url. Rather than redirecting to http://www.newsite.com redirect these to http://www.newsite.com?FromOldSite=Y

Would you just redirect these to a particular launch page? Like if try attempt to visit http://oldsite.com/desired/page, just send these to http://newsite.com/welcome?nextpage=/desired/page. The welcome page could show the content after which pass them to this content. Alternatively, you can send them to the brand new page having a ?show_welcome=true within the URL.

Unsure the way you intend to redirect your customers, but when you won't want to "ugly" your URL, you may just set your personal custom header when striking that old site after which check for this in the new.