Redirects going to 404 page instead of existing redirect page

All but two of my redirects are working. The two that don’t work send the visitor to my 404 page. Each of the two non-working redirects includes a splat.

The first may be unnecessary, but I’m trying to redirect HTTP requests to the non-custom domain to HTTPS and to my custom domain.

http://grorg.netlify.com/* https://www.gregraven.org/:splat 301!

The second is copied and pasted from the “How to redirect the default Netlify subdomain to your primary domain” pop-up box on the domains page for this domain.

https://grorg.netlify.com/* https://www.gregraven.org/:splat 301!

I tried turning on Pretty URLs, but that seemed to make no difference.

It’s probably something stupidly simple, but I’m not seeing it.

I should mention that I’ve run the entries in my _redirects file through the Netlify Play utility several times, and each time Play says my redirects are valid.

Any thoughts?

Hi, @gregraven, the redirect does appear to be working when I test:

$ curl -svo /dev/null http://grorg.netlify.com/index.html  2>&1 | grep -i "< location"
< Location: https://www.gregraven.org/index.html

Did you resolve it on your own already?

If not, what URL isn’t redirecting when you test?

Thanks for responding.

I replaced the splat with a brute-force approach, meaning, I created a separate redirect for each page on the site.

Not very elegant, but it seems to be working.

That redirect would need to be first in the list to work as you’re expecting, Greg. We parse redirects in order, so maybe it was after your SPA redirect or some 404 rule? the playground is good (not great - it’s a different codebase than production uses) for syntax checking, but it doesn’t know anything about semantics, so “technically correct and semantically useless” is a potential output from learnings there…

1 Like