How to 301 redirection

Hi all

i used to have 301 redirection managed by my registrar.

This was useful in particular to redirect share links of my owncloud to a subdomain

Now using MIAB as DN server for my domain, how can i achieve a 301 redirection?
For example, I would like sub.myMIABdomain.td → https://myOwncloudDomain.td/index.php/s/whatever

Thanks in advance for your help

Well you could always go back to external dns and then duplicate the entries under the external dns tab (in admin panel) to your registrar…

Technically, a 301 permanent redirect (which is permanent), is an HTTP status code, meaning it is sent to a browser from an HTTP server.

I still haven’t gotten around to using it, but there is a hidden feature in MiaB to support custom nginx configurations for each domain. It makes use of either .conf files or custom.yaml or something in /home/user-data/www/, and you could use that to create a redirect or return configuration.

I probably never use such features because I have a different server I would set up the A record to point at and configure the redirect there.

You also can use a simple HTML page that redirects, but it is just a refresh to a different URL, not a 301 status code.

I’m trying the “custom.yaml “ hidden feature, but I’m not able to make it work.

I’ve created a “custom.yaml” in /home/user-data/www

mysub.domain.td:
   redirects:
      ^/$: $scheme://www.google.com

And then run

sudo /root/mailinabox/management/dns_update.py

But no luck.
Nothing concerning mysub.domain.td

Can someone who knows how to use this undocumented feature of Mail-in-a-Box PLEASE document it, please? @JoshData @davness