This is not possible as-is. If you return a 301
, the browser will follow it, and not display any HTML you may have sent.
Alternatively, you could return 200
, along with the following:
<div>The new site is at newsite.com</div>
<script type="text/javascript">
setTimeout(function() { window.location('newsite.com'); }, 60 * 1000);
</script>
This displays the div and redirects the user (after 60 seconds) but won't inform search engines that the content has been moved to the new site.
You can (somewhat) alleviate SEO woes with rel="canonical"
, but Google et al. recommend against it (your situation is what 301's were made for, rel="canonical
says "There are two versions of this content, only index the one over here):
<head>
<link rel="canonical" href="newsite.com">
</head>
<body>
<div>The new site is at newsite.com</div>
<script type="text/javascript">
setTimeout(function() { window.location('newsite.com'); }, 60 * 1000);
</script>
</body>