Other pages showing as 404 but work with plain permalinks

Are your other pages shows as a 404-error, however, work when you set your permalink structure to plain (?p=123)? All you may need is to try the following options.

Check your .htaccess file

Check your .htaccess file to ensure that the paths are correct, as this can often cause errors.

The default .htaccess file should look like the below:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Note: once you’ve changed this, be sure to refresh your permalinks once again.

Debug your functions.php file

It might be a rewrite rule from a custom post type in your functions.php file.

A simple way to test this is to:

  1. Clear your functions.php file (make a backup first).
  2. Refresh your permalinks.
  3. Try to check if your page works.

If the pages work, simply put each function back, one-by-one, whilst refreshing permalinks each time, until you reach the function causing the issue.

If you enqueue styles and scripts correctly in WordPress, you’ll notice your styles disappear when you try this, making it harder to see if the page actually works.

Therefore, it might be okay to keep this function in, whilst debugging your functions.php file.