Other pages showing as 404 but work with plain permalinks

Are your other pages showing a 404-error after you’ve migrated a WordPress website to another server to go-live? Or perhaps they’re only working with plain permalinks?

All you may need is to check your .htaccess file.

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]
# END WordPress

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

Refresh permalinks

Often when you make directory or file changes, you’ll need to refresh your permalinks in WordPress.

You can do this by following the steps below:

  1. Go to your WordPress Admin dashboard
  2. Go to Settings>Permalinks
  3. Don’t change anything and click Save Changes

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.