How to Make Your Mastodon Profile Discoverable Using Your Own Domain on Firebase Hosting

While it’s cool to host your own Mastodon server, it’s not really efficient. A simple thing you can do, however, is to make it easier for others to discover your presence, if they already know your website. Try it out – search for “” in your Mastodon instance. Also, click “follow” for SEO tips & other bad takes.

Why is hosting your own instance inefficient? In short, sending updates between users (followers, followees) means connections between their individual servers, and if everyone has their own server, it’s a lot of network activity. It costs you money, it costs them money. It’s better if you share instances (and support your server).

Be discoverable with your domain

The solution is Webfinger. On the basis of a set of “well-known” URLs that you host on your website, a social network like Mastodon can look up your account, and present that to the user. We don’t have to make the contents of these URLs ourselves (though you could), we just need to redirect to our official ones.

Practically speaking, you have to redirect two URLs (and tweak their query parameters):

  • /.well-known/host-meta
  • /.well-known/webfinger

The query parameters (as stolen from another blog post) is the same for each one: ?resource=acct:username@domainname. To make this work with Mastodon in general, you will need to swap out the username and domainname to match the account that you actually use.

For me, that looks like this:

  • 301 redirect:
  • From:
  • To:

If you try the link, you should get an XML file from, showing that my account exists. Maybe it still exists when you read this post?

See also  Embedding Mastodon Posts Static and Privacy-Focused Way

Redirects on Firebase hosting

I ran into a slight snag when doing this for the Firebase static hosting that I use. In particular, you can’t redirect with query parameters. What year is this? Anyway, luckily that doesn’t stop me.

Workaround: URL shorteners will redirect for you. I use I set up short URLs for each of the URLs needed, and used Firebase redirects to point to them. My firebase.json includes the following:

  "hosting": {
    // ...
    "redirects": [
      "source": "/.well-known/host-meta",
      "destination": "", // ""
      "type": 301
      "source": "/.well-known/webfinger",
      "destination": "", // ""
      "type": 301
    // ...

This works surprisingly well. As a by-product of not supporting URL querystring parameters, any address will point to my Mastodon account. I don’t know if this is good or bad, but feel free to add me with “”. Also, I don’t have email set up, so spam away.

The social plus

Back in the days of Google+, it was en-vogue to set up a /+ URL on your site to point to your Google+ profile, since those URLs were really weird. Let’s do that here too, for old-times sake. In my firebase.json I include:

    // ...
    "redirects": [ 
      "source": "/+",
      "destination": "",
      "type": 302

Yes, is a 302 redirect. Who knows where it’ll point to next?

And just for sake of having too many redirects, I also set up to do the same redirect. It’s probably overkill, just pick one profile redirect URL and stick to it is easier. Right?


Shortly after posting this, Michael Nolen mentioned how you can do this directly in WordPress, using the Redirection plugin. Also, he suggested that it’s probably enough to only redirect the webfinger .well-known URL.

See also  Embedding Mastodon Posts Static and Privacy-Focused Way
WordPress redirect for webfinger

(screenshot from Michael Nolen)

Apache & co

I have no practice in Apache redirects anymore. I’m guessing something like this will do it in your .htaccess file:

RewriteEngine On
RewriteRule ^.well-known/host-meta(.*)$ [L,R=301]
RewriteRule ^.well-known/webfinger(.*)$ [L,R=301]

Let me know if I got this wrong, or rather, if there’s a better way to do it in Apache. If you have a post explaining this for other servers, happy to link there too.

Other platforms

I found these, let me know if you have others to link to:


Social proof

Screenshot of Mastodon showing a search for


With the URL redirector, you can check the usage to see how often it’s actually used over time. Is it worth it? After 3 months, not a ton of usage, but it does seem to work:

Screenshot of bitly stats
  • /.well-known/nodeinfo: 6 uses
  • /.well-known/host-meta: 9 uses
  • /.well-known/webfinger: 64 uses (which seems like a sign that this is the one you really need)


  • 2023-02-11 – Removed /.well-known/nodeinfo mention – it’s apparently only needed for Mastodon instances. Thanks, Braedon!
  • 2023-02-11 – Added bitly stats for redirects
  • 2022-11-09 – Added a link to the WordPress version, and Cloudflare pages, Django, nginx links.

Mohamed SAKHRI
Mohamed SAKHRI

I'm the creator and editor-in-chief of Tech To Geek. Through this little blog, I share with you my passion for technology. I specialize in various operating systems such as Windows, Linux, macOS, and Android, focusing on providing practical and valuable guides.

Articles: 1378

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *