Home
Support Forums

Simple redirect from root / not working [SOLVED]

Not sure why the following redirect isn’t working on my site
frenchplus.netlify.app

As far as I can tell, looking through the guide and other questions here, I’m doing everything correct.
(I’ve tried quite a few permutations, such as full url’s and index.html’s)

[[redirects]]
from = “/”
to = “/under-construction/”
status = 200
force = true

Seems simple enough in theory, but in practice its not working.
Any advice please?

Try this:

[[redirects]]
  from = "/"
  to = "/under-construction/"
  status = 302
  force = true

Cheers Coel, thanks for looking at this.
I gave that status change a shot, and my build again says the redirect rules are processing fine, but still no luck :slightly_frowning_face:

* **2 redirect rules processed**
All redirect rules deployed without errors.

That rule works for me.

What is the other rule that was processed?

Good pickup - it’s one I copied from Netlify for 404 redirects (and was previously working fine by itself).

[[redirects]]
    from = "*"
    to = "/404"
    status = 404

As per rule processing order

The redirects engine will process the first matching rule it finds, reading from top to bottom. Rules in the _redirects file are always processed first, followed by rules in the Netlify configuration file.

So you want them like this

[[redirects]]
  from = "/"
  to = "/under-construction/"
  status = 302
  force = true

[[redirects]]
  from = "*"
  to = "/404"
  status = 404
1 Like

Whoa, that worked Coel !!

Many thanks for sticking with this, really appreciate your persistance & help :smiley:

1 Like