A client's site says 404 Not Found: what to do
The server answered, and it says there is nothing at that address. Either the page has gone, or the server is looking for it in the wrong place. Here is the order we would work in.
1. One page, or the whole site?
- Only one page. The page was deleted, unpublished or renamed, and something still links to the old address: a menu, an ad, a printed card, a search result. Go to step 3.
- The home page works, every other page is 404. On WordPress this is nearly always the rules that turn a pretty address into a page. See the WordPress cause in step 3.
- Every page, the home page included. The server that answered does not have the site where it is looking. This usually follows a move to a new host, a new domain or a change to the hosting account.
If the page says something else, such as 403 Forbidden, see what to do about a 403; if it says 500, 502 or 503, see what to do about a server error.
2. See where the address really ends up
An address can redirect several times before it reaches the 404, so ask for the last stop as well as the code. From a terminal:
curl -sSL -o /dev/null -w "%{http_code} %{url_effective}\n" https://example.com/pageOn Windows, type curl.exe rather than curl, and use NUL instead of /dev/null. It prints the code and the address it ended on. If that address is not the one you asked for, the problem may be the redirect rather than the page: an old rule sending visitors to a page that no longer exists, or to the wrong domain.
If it prints 200 but the browser shows "Page not found", the site is showing its not-found page without saying so. Search engines call that a soft 404. It is the same problem, and anything that only reads the code will think the page is fine.
3. The usual causes
- The page was moved, renamed or deleted. Check the site's bin and drafts first. If the page moved on purpose, add a permanent (301) redirect from the old address to the new one, so old links and search results still land somewhere.
- WordPress permalinks. If the home page works and the rest do not, go to Settings, then Permalinks, and click Save Changes without changing anything. On Apache and LiteSpeed hosting that rewrites the rules in .htaccess, and it fixes most cases. On Nginx hosting there is no .htaccess, and the host has to add the rule that passes addresses to WordPress.
- The files are in the wrong folder. After a move, the site may have been uploaded one folder too deep, or the domain may point at a different folder from the one the files are in. The hosting control panel shows which folder the domain uses.
- Capital letters. Most Linux hosting treats the files
/About.htmland/about.htmlas different addresses. Links to files that worked on a host that ignored capitals can break after a move. - A plugin or an update removed pages. Shop, booking and membership plugins often create their own pages. If one was turned off or its update failed, its pages go with it.
4. Check the fix
Run the command from step 2 again. It should print 200 and the address you expected. Then open the page in a private browser window, so you are not seeing a copy from your own browser's cache. If you added a redirect, try the old address too: it should land on the new page.
5. Tell the client what happened
They may have heard about it from a customer first. For example:
Some pages on the website were showing "Page not found" after a change on the server. I have put them back and checked each one loads again, and old links to them still work.
6. Next time, hear about it first
For Bionic Uptime, a 404 is a failed check, like any 400 or 500 code. We follow redirects and judge the page they land on, so an address that redirects to a 404 fails too. When both of our locations, on two different companies' networks, and a retry agree within 45 seconds, while both locations are known to be working, it is confirmed as an outage and each person on that website's alert list gets one email. It names the code. When all three got a 404, it says: "Both checking locations received HTTP 404." A failure that has cleared by the retry does not send an outage email. See the exact outage email.
What it cannot see: we check the one address you give us for each website, usually the home page. A broken page elsewhere on the site is not checked. If another page matters as much, such as a booking or contact page, add it as a website of its own; each address counts as one of your websites. A soft 404 answers 200, so a check on the code alone calls it Online. To catch it, turn on Also check what the page says when you add the website, choose Must say, and type a phrase that is only in that page's own content, not in the header or footer, because the site's not-found page usually keeps those. Or choose Must not say and type the words the site's not-found page shows, such as "Page not found".
3 websites are free, forever, with no card. Looking after several client sites?