Redirecting path to subdomain

Normally, I’d use NGINX to handle a redirect where the new url points to the location where the files are. Do I need to provide a domain to achieve a 301 redirect?

Essentially, my original path is this. I’ve added a file called netlify.toml:

# A redirect rule with all the supported properties
  from = "/apps/*"
  to = ""
  status = 301
  force = true
  headers = {X-From = "Netlify"}

The redirect works but I expect to see the page. Is this correct? Do I need to add a custom domain before seeing the page? Not sure I can redirect to a sub domain of a sub domain (elastic-joliot-524d89) :smile:

PS: Im using Nextjs

“expect to see the page” - what page is missing? That redirect should send to with a 301 status. If you mean instead to show the page rather than redirecting, you want a rewrite; use status 200 instead of 301 :slight_smile: (more details here:

Your “headers” won’t do anything on a 301 redirect (but it will with a 200!)

1 Like

Hi @SylarRuby,

I just took a look at and you don’t have a netlify.toml or a _redirects file. Do you have the netlify.toml with the redirect in the root of your repo? Note that @fool’s point is also correct int hat the custom header only works for proxied requests.

1 Like

Many thanks for the replies. I once had that .toml file in. I was lost so I removed it, added a custom domain and forget about the /apps and use /xero instead. It’d be immensely greatful to have the original plan to work: /apps/* to

“I’m texting from mobile”

I’ll try the suggestions later and report my findings. Thanks

1 Like