Mastodon Redirect

• Site name:
• Domain

I have setup a mastodon server on a subdomain on and would like for the root domain to redirect requests not found on the routes. The documentation on mastodon mentions nginx redirects, specifically through the WEB_DOMAIN environment variable.

Question: How would I go about setting up a redirect on my netlify hosted website? The documentation gives the following example:

location /.well-known/webfinger {
  return 301$request_uri;

Side note, the root website is open-source: GitHub - rehatkathuria/

Hey kth,

To create a redirect, you can put it in your netlify.toml file or a _redirects file and it will automatically be detected upon deploy. You would need to use splats as a catchall here.

To format this redirect for a _redirects file, it would look like this:

/.well-known/webfinger/* 301

You can learn more here: Redirect options | Netlify Docs