Will my micro.blog subdomain always work?

I’m weighing my options for adding a custom domain to my micro.blog hosted blog. At the moment it’s at [username].micro.blog and I’m wondering whether, if I add the custom domain, redirects from the micro.blog subdomain will always work for all uses.

I’ve done a little testing on others’ blogs that use this setup, and here’s what I think I’ve found to be true:

  • navigating to [username].micro.blog[custom].[domain]
  • navigating to [username].micro.blog/foo[custom].[domain]/foo

Will this remain true, even for content added after the custom domain has been added? ie. if I make a new page at [custom].[domain]/bar will it also be accessible via [username].micro.blog/bar?

One of my fears here is that I have a lot of uploads referenced in posts (and on pages) in two different formats:

<img src="https://[username].micro.blog/uploads/2023/95069550dc.jpg">

but also without the subdomain, just as a relative path:

![](/uploads/2023/e2799c9b60.png)

Will both of these addresses still work after the custom domain is linked?

And, just as importantly, what URL format will new media have if it’s uploaded after the custom domain is attached? ie. will it retain the [username].micro.blog/uploads/... format, or will it be given a path like [custom].[domain]/uploads/...? Obviously the latter would increase the risk of something breaking if I was to move away from the custom domain in the future. (Perhaps this is made either simpler or more complex by the choice to use the CDN?)

Finally, since I’ve already asked a whole tangle of related questions here, let me raise one other thing that I encountered whilst thinking about this. I took a look at the batch find & replace functionality, as a potential way to make the relative path style link addresses above into versions with the subdomain included. My intention was to search all my posts for the string

](/uploads/

and replace that with

](https://[username].micro.blog/uploads/

However, the search function throws an error when searching for the former string. I’m guessing it doesn’t like the leading square brackets or all the forward slashes? Thought it was worth mentioning.

If anyone has answers to even some of these questions, I’ll be most grateful. Thanks.

Below are what the help page says about adding or changing a custom domain. In other words, it should just work. But if something should go wrong after migration, I would be surprised if @manton didn’t help out a paying customer and fix the problem. I imagine broken blogs are pretty bad for business in the long run. :blush:

As well as adding a custom domain from username.micro.blog to yourdomain.com, you can change to yourotherdomain.com in the future. When adding a custom domain for the first time, or changing to a new one, various things may appear broken for a while:

  • None of your images will load
  • HTTPS won’t initially be enabled, so visiting your site may show an “insecure message”

Both of these are normal. Behind the scenes, we’re automatically setting everything up. Things should clear up in about 48 hours.

1 Like

Thanks Sven, and you’re almost certainly correct. However, both @manton and yourself have already helped me fix something else I’ve broken, so this was my attempt at thinking through all the possibilities before breaking something else!

I think for now I might stick with the micro.blog subdomain as the canonical URL, and use DNS to redirect a custom domain to it.

FWIW I made the switch years ago from micro.json.blog to json.blog once custom Hugo themes were allowed and it was seamless. That was one custom domain to another, but everything translated over.

I’d recommend doing a full content export first, which will get you your raw markdown, images, and theme files etc, but I wouldn’t have a high level of concern with this shift.

1 Like

Excellent, I appreciate the encouragement. Also, poking around on your site it looks like, when you make a post / page at [custom].[domain] it does automatically create a redirect from your micro.blog subdomain, which is great.

Can you answer one specific question for me: when you upload media to micro.blog now, how is the URL formatted when you click the ‘Copy HTML’ button? Does it use your custom domain in the string?

Yes-- copy html is the full path to the image at the domain. (I never use this method, but I checked and that’s what I got). Example: <img src="https://json.blog/uploads/2023/2addeaddb4.png" width="600" height="446" alt="" />

1 Like

Yep, as you’ve discovered and others have pointed out, we automatically redirect everything from the Micro.blog subdomain. Every once in a while there is a glitch setting up the universal redirect, but if that ever happens, just ping me and I can update it for you. Once it’s set up, it will work forever for all possible URL paths.

It was an early design goal for photo URLs to be at your own domain name. If you enable the CDN for photos, though, it will use the Micro.blog CDN URL for that.

The only place that the Micro.blog subdomain pokes through when using custom domain names is the GUID for RSS items. We do that so that it’s a permanent identifier even if your custom domain name changes, and blog visitors should never see that.

1 Like

Wonderful, thanks for taking the time Manton.