03 March 2010
Migrating from an FTP custom domain to blogspot.com and maintaining Google links
This change was forced upon me by Blogger, who have decided in their infinite wisdom to depreciate the option to publish your blog by FTP. This meant I could still use Blogger software, but had to switch the address the blog was at from http://jephso.spheresofchaos.co.uk/blog/ to a different, custom sub-domain or to using Blogger's free blogspot.com service. At first I wanted to switch services to Tumblr, but that had no feature to import my past posts from Blogger. Next I tried Wordpress, but their import feature didn't work, only importing about 5 of my posts. Also, you can't use custom templates on Wordpress very easily, so, as you can see, in the end I stayed with Blogger and went with a new URL of http://jephso.blogspot.com/.
But many of my pages get a lot of hits from Google, and so I wanted to make sure I didn't lose my recognition from Google in the switch. I also wanted to redirect my feed, so that anyone subscribed to the old feed (http://jephso.spheresofchaos.co.uk/blog/rss.xml) would be directed to the new one (http://jephso.blogspot.com/feeds/posts/default?alt=rss).
Accurate redirects would mean that users would actually reach the content they were looking for, and apparently having accurate redirects helps Google update itself with your new page locations - one of the annoying things about having to switch is that Google no longer knows where your pages are until it has crawled them, which can take a while, and so the custom Google search tool on the right of my blog no longer works. This should become useful again once Google has crawled all my pages though.
Apparently Blogger will unveil a tool to migrate everything automatically for you soon, but it's not available yet. So in the hope that this info may be of benefit to others who are making the switch, here's what I did:
At first I redirected the feed by placing a .htaccess file in the jephso.spheresofchaos.co.uk directory which simply said:
Redirect 301 /rss.xml http://jephso.blogspot.com/feeds/posts/default?alt=rss
I then placed another .htaccess file in the jephso.spheresofchaos.co.uk/blog directory which said:
Redirect 301 / http://jephso.blogspot.com/
That directed all traffic from from my old posts to the new homepage. But I wanted to maintain page-to-page links, so that someone clicking on a Google link to one of my posts would go to the exact post they clicked on, rather than just the blog homepage. After playing around with .htaccess files for a while I found that simply placing the following .htaccess file in the jephso.spheresofchaos.co.uk directory did the trick:
Redirect 301 /blog/ http://jephso.blogspot.com/
Now when a user clicked on one of my old posts from Google they would be directed to the same post, but at its new location. One more problem though. At some point Blogger must have changed the way URLs for labels are formed. On my old blog a list of posts under one label, for example, books, would be listed at http://jephso.spheresofchaos.co.uk/blog/labels/books.html. But on my new blogspot.com blog it's listed under http://jephso.blogspot.com/search/label/books/. There didn't seem to be a quick-fix solution to solve this, so I created manual redirects for each label, resulting in a big .htaccess file that looks like this:
Note that the order of the redirects is important. As browsers check the top entry first, you want specific redirects towards the top, then more general ones towards the bottom. Also note that if you have spaces or other punctuation in your webpages, you may need to add equivalent code or put speech marks around the addresses, or else they won't be read properly.
I then went to Google and searched site:jephso.spheresofchaos.co.uk/blog/ to find all the links Google has to my old site. When doing this for yourself, remember to clear your browser's cache every time you make changes to the .htaccess file for the changes to be picked up.
Now all the old links run through to my new blog, and the new links should be picked up by Google soon. To be honest, this whole palaver has got me back into regular blogging again. I just hope Blogger don't decide to change anything again anytime soon, as this blog is now in its third incarnation. Classic templates (which I use for this blog) could be the next thing to go, but everything's sorted for now. And if you haven't subscribed to the new feed yet, make sure you do at http://jephso.blogspot.com/feeds/posts/default?alt=rss.
Labels: blogging, internet, technology