I just moved some posts here from an old Blogger blog that I made many years ago. Now that all my posts are here I wanted to redirect the whole old blog to this new one. Blogger doesn't have a built-in way to do it, but it can be done! Here's how:
First, log into the Blogger console and go to the "Theme" section. There is a "Customize" button with a drop down menu. First, in the drop down menu, select "Mobile Settings", then choose to show the Desktop theme on mobile devices. This will ensure that mobile devices get the redirects we're about to add.
Now, in the same drop down menu, choose "Edit HTML". Right after the opening <head>
tag you'll insert some code that will add <meta http-equiv='refresh' ... >
tags that redirect every specific blog post, as well as a catch-all redirect for all other pages on your blog. Here's what that looks like in my case, redirecting the old jdarpinian.blogspot.com
to the new james.darpinian.com/blog
:
<b:if cond='data:blog.url == "https://jdarpinian.blogspot.com/2013/12/pebble-vs-qualcomm-toq-smartwatch.html"'>
<meta content='0;URL='https://james.darpinian.com/blog/pebble-vs-qualcomm-toq'' http-equiv='refresh'/>
<b:elseif cond='data:blog.url == "https://jdarpinian.blogspot.com/2014/06/homebrew-oculus-rift-eye-tracker.html"'/>
<meta content='0;URL='https://james.darpinian.com/blog/eye-tracker'' http-equiv='refresh'/>
<b:elseif cond='data:blog.url == "https://jdarpinian.blogspot.com/2017/04/tensorflow-tidbit-whats-up-with-0-in.html"'/>
<meta content='0;URL='https://james.darpinian.com/blog/tensorflow-0-in-names-of-variables'' http-equiv='refresh'/>
<b:elseif cond='data:blog.url == "https://jdarpinian.blogspot.com/2017/04/tensorflow-tidbit-incompatible-with.html"'/>
<meta content='0;URL='https://james.darpinian.com/blog/tensorflow-incompatible-with-expected-float_ref'' http-equiv='refresh'/>
<b:else/>
<meta content='0;URL='https://james.darpinian.com/blog/'' http-equiv='refresh'/>
</b:if>
There's one specific <b:elseif
that matches each blog post by URL, and the <b:else/>
at the bottom redirects all other pages. Simply paste that code into your theme and replace all my URLs with yours (make sure to preserve the "
and '
parts, those aren't part of the URLs). Once you save your change you can test it immediately by visiting blog pages and seeing that they redirect as expected.
I wish Blogger had a built-in option for this using real HTTP 301 redirects, but this method seems to work well enough.