WordPress permalinks and the 404 that follows

You changed the permalinks, moved the site or updated something, and now only the home page opens: everything else returns a 404 error. Almost always the content is fine. What broke is the rule, written in the .htaccess file, that sends pretty addresses to WordPress. Work through it in this order.

First: who is answering?

Look at the error page. If it comes dressed in your theme (header, menu, footer), WordPress is alive and cannot find that address: the problem is the permalink or the content itself. If it is a bare, plain page like any server would show, the request never reached WordPress: the rewrite rules are missing.

The steps, cheapest first

1 Save the permalinks again. In Settings, Permalinks, change nothing and press Save Changes. That forces WordPress to rewrite its rules, and it solves most cases.
2 Check that .htaccess exists. Open File Manager, in the Files section of cPanel, go to the folder WordPress lives in and, in File Manager’s settings, tick the option to show hidden files (the ones starting with a dot). Without it, .htaccess stays invisible even when it is there.
3 Check it holds the WordPress block. Between # BEGIN WordPress and # END WordPress you should see something like this:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Yours may carry an extra line, depending on the version. If the file is empty or lacks the block, paste it in.
4 Check WordPress can write to the file. If .htaccess belongs to another user, or refuses writing, saving the permalinks fails without a word. The site’s files should belong to your account.
5 Look for rules that fight these ones. A second .htaccess in a folder above, rules left by a security or cache plugin, an old redirect. To test, keep a copy, rename the file and save the permalinks again: WordPress writes a clean one.
6 Deactivate the plugins. If the 404 goes away, switch them back on one at a time until the culprit shows. If you cannot reach the dashboard, see disabling plugins even when you cannot sign in.
7 Try the “Plain” structure. If pages open with it and not with the others, you have proof the fault sits in the rewrite rules and not in your content. Then go back to the structure you want and repeat the steps above.

What you see, and the likeliest cause

What you see Likeliest cause
Only the home page opens; everything else shows a plain error page .htaccess is missing, empty, or lacks the WordPress block.
A 404 dressed in your theme The link changed, the post is a draft or was deleted, or the rules for a content type (shop, portfolio) were not rewritten. Save the permalinks.
It worked before you moved the site .htaccess got left behind in the copy because it is a hidden file. Or the site went from a subfolder to the root.
New pages return 404 while old ones open A plugin added a new content type and the rules were not refreshed.
Do not change the link structure on a site that already has visitors. Every old address starts returning 404, and anyone who saved it, or found it in a search, lands on an empty page. If you really must change it, create redirects from the old address to the new one: see 301 redirects when you change a page or a domain.
.htaccess is the file people forget most when copying a site by hand, precisely because it is hidden. Before you copy, switch on hidden files. The walkthrough is in moving a site by hand.

To make sense of the other errors a site can return, see errors 500, 403, 404 and 508.

Followed the steps and the 404 is still there? Tell us the address of a page that fails and what appears, and we will look from our side.

Open a support ticket

SEE ALSO

WordPress hosting

Support Policy

Frequently asked questions

RECOMMENDED PRODUCT

WordPress hosting

One-click install, updates handled, and speed that holds up. from £5.28/mo (3-year plan, with coupon)

See plans
  • 0 Users Found This Useful
Was this answer helpful?