That’s weird. This was working for a minute and then… stopped. I started to receive Netlify-served 404 pages for the URLs mycustomdomain.com/wp-admin
and mycustomdomain.com/wp-json
instead of it actually working, like it did for a bit…
But looking at my published deploy summary, I noticed this:
This leads me to believe that the _redirects
file that I set up, using @verythorough’s recommendation is not being processed. Here’s what I have:
/wp-admin https://wp.mycustomdomain.com/wp-admin 200
/wp-json https://wp.mycustomdomain.com/wp-json 200
I’m not sure how it was working before. When I use curl to visit the URLs mentioned above, again I get a 404.
I can’t redeploy my site without it breaking, because for it to work it has to query /wp-json
to compile correctly, so I can’t try moving the _redirects
file to a different directory (right now it’s in the static
directory using Gatsby. I read that this was the folder that gets compiled in the build and ends up in the build root).
In Netlify, I have my primary domain set up to use a DNS record that creates wp.mycustomdomain.com
using an A record that points to the IP of my backend server. TTL is 60. (Also noteworthy is that the IP I’m pointing to is a shared server with multiple accounts. I’m not exactly sure how Netlify distinguishes which account to access without a “key path” as to which one to use).
At my domain registrar, I’m pointing the domain to Netlify’s nameservers. And have an A record set up pointing to your load balancer’s IP, plus a www
CNAME record pointing to my default Netlify subdomain.
Interestingly too, around the same time, my SSL certification with Netlify and Let’s Encrypt appears to have broken. I get a warning dialogue under the HTTPS section in the Domain management section that says:
mycustomdomain.com doesn’t appear to be served by Netlify
I went through the troubleshooting with that and my page is being served by Netlify servers. Although it could have something to do with DNS cache, I have been constantly clearing the browser cache in my browsers and still the same results. It’s been a few days now. Update I have just tried flushing DNS cache for the A record for the root domain.
This strange behavior seemed to happen around the same time that I was setting up a domain name redirect for a second domain. At one point in my domain registrar’s (Google Domains) DNS settings for the secondary domain, I set up a www CNAME record that pointed to my primary domain URL. There was also a line in my Netlify _redirects
file that referenced the domains together:
https://www.myseconddomain.com/* https://www.mycustomdomain.com/:splat 301!
(all one line)
I’ve since removed any domain settings I had for the second domain in my Netlify backend UI. Currently, the only setting I have is with Google Domains, which redirects mysecondarydomain.com
to mycustomdomain.com
using their redirect system.
I’m at a loss…
Update:
I just saw that my static folder was not in the proper location in my Gatsby project. I’ve moved it but