Redirect not working with domain

Hello.

I have a web app that is working both on the domain jnsst.netlify.app and on the domain jnsst.com.br (domain purchased).

When I go to redirect the subdomain cat.jnsst.com.br to the directory jnsst.com.br/cat it doesn’t work.

The /cat directory works, only the redirect does not.

Follow the Netlify.toml file for subdomain redirection.

[[redirects]]

from = “/cat”
to = “https://cat.jnsst.com.br
status = 200
force = true

Hey @ElemarLeonel,

I’m not sure what you’re trying to do. I can see the cat subdomain is also connected to the same site:

So, you’re trying to redirect /cat back to the same site?

@hrishikesh

My intention is that, when typing the address https://cat.jnsst.com.br, the customer is redirected to the address www.jnsst.com.br/cat.

If you type the address www.jnsst.com.br/cat it works normally, but this redirect that I explained above doesn’t work.

Was it explained well?

Hi @ElemarLeonel,

Thanks for the clarification.

Could you try the following redirects in your netlify.toml and let us know if they work for you?

[[redirects]]
    from = "https://cat.jnsst.com.br/*"
    to = "https://www.jnsst.com.br/cat"
    status = 301
    force = true


[[redirects]]
    from = "https://cat.jnsst.com.br/*"
    to = "https://www.jnsst.com.br/cat"
    status = 301
    force = true

Let us know if the above redirects work for you or if you have any questions.

Hello.

I used the way you mentioned above, the redirect worked, however, I can’t see what’s inside my page with the address /cat.

Is there any other configuration that can be done?

Follows in this post the error directly from Netlify.

You need this file:

[[redirects]]
  force = true
  from = "https://cat.jnsst.com.br/*"
  status = 301
  to = "https://www.jnsst.com.br/cat/:splat"

[[redirects]]
  from = "/*"
  status = 200
  to = "/index.html"
1 Like

image

I did more or less the way you suggested and it worked.

Thank you very much!