As a small reward for managing to write a bit more lately, I decided to set up a proper domain: here comes aldur.blog!

This post details the few steps I took to migrate. If it all went as expected, you might already be there, and you won’t notice a thing. If instead you find anything broken, please let me know (you will find my contact info in the footer).

# Migrating

We will have to migrate (again) and redirect readers from the previous domain to the new home. Last year I built some experience with it when migrating away from GitHub pages. This time it will be a bit easier, because the host (Cloudflare) is not changing. We just need to switch domains, and Cloudflare’s redirects will do most of the heavy lifting.

To refresh things, we will need to:

  1. Redirect each page to the corresponding page on the new domain.
  2. Inform your RSS users1.
  3. Take care of SEO.
  4. Nits and Bits.

# Redirect each page

Our goal here is to redirect each blog post (and the occasional additional page) to the corresponding item on the new domain.

Cloudflare’s docs include an article to get started with this. If you are following along, you’ll have to make a few modifications:

  • The “Bulk Redirect” section has moved to the bottom of the sidebar. Once you find it, you’ll need to add a redirect list and then a redirect rule.
  • Differently from what the documentation suggests, you’ll need to use your concrete <you>.pages.dev subdomain, instead of the wildcard. I learned this the hard way.
  • I chose not to redirect subdomains in the configuration, since that allows me to see deployment previews that Cloudflare will publish on subdomains (e.g. <branch>.aldur.pages.dev) through GitHub integration.
  • I started with a 301 return code (“moved temporarily”) and then turned it into a 302 after testing it for a while.

A screnshot from Cloudflare's dashboard showing a 301 redirect from
`aldur.page.dev` to `https://aldur.blog`. You’ll need to configure the bulk redirect this way instead of using the wildcard.

After setting all up and giving Cloudflare a second to propagate the results, curl correctly reports the 301:

$ curl -q --head  https://aldur.pages.dev
HTTP/2 301
date: Tue, 29 Oct 2024 09:52:53 GMT
content-type: text/html
content-length: 167
location: https://aldur.blog

We could also redirect www to the apex domain, but since it is not the 90s anymore, we won’t do that.

# Inform your RSS users

Now, I’d like to transparently allow users to continue pulling the RSS feed from the new domain. Easy! The 301 redirect that we just configured seems to be the standard approach to do that.

I was able to test this2 by subscribing through my own feed before making the change.

# Take care of SEO

Lastly, we need to inform search engines about the change. This blog relies almost exclusively on relative links. It uses absolute links only where required by standards (e.g., the sitemap and the RSS feed).

This PR updates Jekyll’s URL, used in Cloudflare deployments to create the RSS feed and the sitemap.xml.

In addition, having a root domain means that I could use DNS verification from the Google Search console. So I removed the custom meta tag in the HTML that I used before to verify my “property”.

As a nice bonus Google would not load my sitemap.xml.

A screnshot from Google Search console showing an error while trying to upload
a sitemap. “Impossible to fetch”: I consistently got this before, most likely because of the subdomain.

A screnshot from Google Search console successfully upload a sitemap. Green success, even if you don’t read Italian.

Hopefully, search engines will now: pickup new posts from the new domain and redirect traffic and visitors directed to the old one.

Out of abundance of caution, I also tried visiting my robots.txt page and noticed something unexpected:

$ curl https://aldur.blog/robots.txt
< HTTP/2 301
< date: Wed, 30 Oct 2024 07:32:26 GMT
< content-type: text/html
< location: https://aldur.blog/robots.txt

A quick search led me to configure strict SSL settings within Cloudflare (which doesn’t hurt anyway) and seems to have fixed the issue.

# Nits and bits

This PR updates the email used in the “About” section. If it starts getting spammed, I will deploy the usual countermeasures.

This commit, instead, redirects the old version at aldur.github.io directly here, avoiding an additional redirect.

There are probably a few other things that I did not migrate (e.g., if you preferred a light/dark theme instead of using the OS preference, you will need to re-select it).

But today was long enough, let’s call it a day. Thank you for reading and welcome to my new digital garden 🪴

# Footnotes

  1. Last I checked, I thought that nobody subscribed to the RSS feed. Then I remembered that I am a subscriber and my client requests should appear in the logs. They don’t, because Cloudflare analytics inject a js snippet into a page’s HTML, which doesn’t work for the feed XML. So, if you are reading this through an RSS client: that’s great, please let me know! If you aren’t yet: give it a try, I really like it. 

  2. At least with Miniflux, the RSS client I am using.Â