A main domain to a site and subdomains to 3rd sites

I’m trying to build an architecture where the main domain points to my website and some subdomains points to webapps.

my site is algolive.netlify.app

I’m using the api to send the redirects and this is it:

I’m getting this response when trying to update the site:

"The service Netlify - (updateSite) just returned an error (HTTP 422). Please contact the plugin author directly for feedback. Raw error:

{"errors":{"domain_aliases":["has invalid characters"]}}"

How can i do to make it work?

You can’t update only the redirects using API. You need to deploy all the files as explained here:

Based on the error message, it appears you’re adding redirects to domain alias, which is not supported.

@hrishikesh thanks for your attention!
I’m deploying all files using the first way pointed in the link you sent.

Doing the the splat method on the main domain and pointing the paths to other paths of my website is working perfectly.

My problem is that i cant ponint sub-domains to other websitses.

What i want to do is like:

mydomain.com/* pointing to mysiteA.com/:splat and sub1.mydomain.com point to mysiteB.com/:splat sub2.mydomain.com point to mysiteB.com/:splat

Could you let us know the site name?

@hrishikesh the first site is “algohitspontocom” and have a custom domain (alghohits.com).
The second site, named “sitealgohits”, has a custom domain as a subdomain of the first site and is pointed to another website (hosted in another hosting).
The last site, named prvw, has also has as custom domain a subdomain of the first site but is pointed to a subpath of the first site.

The fist site the follow redirect rule:

/* algohits .bubbleapps. io/:splat 200!

The second site have a custom domain “a.algohits.com” and the follow redirect rule:
/* algohits.com.br 200!

The last site have the custom domain “pre.algohits.com” and the follow redirect rule:

/* https: // algohits. bubbleapps.io/ps/:splat 200!

When i request the url www.a.algohits.com it is working as expected, in a masked redirect to www.algohits.com.br. When i include a path to it, like www. a.algohits .com/contato, i’m being redirected to algohits.com.br/contato, as expected, but the url is changing, as the rule was a 301 instead a 200.

In the last case the rule is not working, the site isn’t loading as expected.

Thanks a lot for your attention

Hi @mbekerman,

Thanks for providing the additional information.

We’re showing that the 301 is not coming from Netlify, but from Wordpress.

You’ll need to disable the redirect in Wordpress.