Migrating to aldur.blog
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:
- Redirect each page to the corresponding page on the new domain.
- Inform your RSS users1.
- Take care of SEO.
- 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 a302
after testing it for a while.
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
.
âImpossible to fetchâ: I consistently got this before, most likely
because of the subdomain.
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
-
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. ↩ -
At least with Miniflux, the RSS client I am using. ↩