Published
- 4 min read
Apex Redirects
Apex Redirects
Back when I started my old blog <checks notes> 16 years ago (!!) I decided to host with WordPress rather than faff about building and hosting my own HTML-based site as I’d always done previously. I didn’t want to host it on the main domain as I wasn’t convinced I’d stick with it, so ran it at blog.activelylazy.co.uk. This was all easy enough to setup, but what I needed to be able to do was ensure that traffic to activelylazy.co.uk got redirected. All I need is a simple redirect…
Cheap Web Hosting
I was already paying WordPress for the privilege of hosting my blog at my own domain, so didn’t also want to pay to run something on the apex domain. In the end I found a cheap hosting company called 5 quid host - I liked the sound of this, £5 a year to host a .htaccess redirect for me. This seemed like a proportionate cost: the traffic would be light, and all it needed was a running Apache httpd instance and a .htaccess file to redirect traffic.
This was in the days before ubiquitous use of SSL, so all I needed was a name-based virtual host that could redirect HTTP traffic to blog.activelylazy.co.uk. This worked fine for many, many years.
Enter TSO Host
Then 8 years ago, 5quidhost was acquired by tsoHost. Very little changed for most of those 8 years: I carried on posting stuff to WordPress, my redirect carried on working, I blissfully ignored SSL on my apex domain. Then recently I got an email from tsoHost telling me that I was being migrated to one of their standard plans. Their cheapest plan would work out at £70/year. This is some price hike from £5/year! Right, that’s it. I quit!
Static site hosting
I decided to move on from WordPress, although it had served me well, it’s a different world from 16 years ago, where the options are no longer a full-featured CMS vs hand-crafted HTML. I decided to use a static site generator instead and after no small amount of yak shaving, I had a static site generated and ready to host. Since S3 is a thing nowadays and you can host static websites via S3, this seemed an easy option. I setup my S3 bucket, configured the CNAME for www.activelylazy.co.uk and boom! new website is live.
Just one more redirect…
While a CNAME works for www it doesn’t work for the apex domain. So I need to work out how to redirect my apex domain to www. After some googling, I discover that NSALIAS is a thing now - although it sounds a bit of a hack and isn’t supported by every domain registrar, including mine. So that isn’t an option. What I really need now is a cheap way of issuing a 301 redirect from activelylazy.co.uk… again.
I’m facing basically the same problem I had 16 years ago! I can’t believe this problem still isn’t solved. The options seem to be:
- Move my domain to a registrar that supports NSALIAS
- Find another super cheap web host
- Setup an EC2 instance to host activelylazy.co.uk
I didn’t really fancy faffing about with option (1). And while option (2) might be viable, my old solution didn’t support SSL on activelylazy.co.uk. Finding a cheap web host that will also handle SSL termination on a fixed IP address seems improbable.
So option (3) it is. More yaks to shave, but with nginx & certbot it was simple enough to setup a http/https redirect for my apex domain. Sure, the cost is nearly the same as it would have been with tsoHost - but I have my own EC2 instance now, to do with as I will.