Fixing WordPress Permalink and 404 Issues

If your WordPress pages are returning 404 errors when they should exist, or links within your site are broken after a migration or plugin change, the most common fix is to flush (regenerate) your WordPress rewrite rules.

  1. Log in to your WordPress admin at yourdomain.com/wp-admin
  2. Go to Settings > Permalinks
  3. Without changing anything, click Save Changes

This regenerates the .htaccess file and flushes the rewrite rules. In most cases, 404 errors will be resolved immediately after doing this.

If You Cannot Access WordPress Admin

If the 404 issue is preventing you from logging in or accessing admin:

  1. Connect to your site via SFTP. See SFTP Access
  2. Navigate to the root of your WordPress installation
  3. Open the .htaccess file
  4. Replace the contents between the WordPress comment markers with the default WordPress rules:
# 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
  1. Save the file
  2. Log in to WordPress admin and re-save Permalinks as above

Only modify the .htaccess rules between the # BEGIN WordPress and # END WordPress markers. Anything outside these markers is added by other plugins or server configurations and should not be removed.

If you have recently migrated your site to Kapsule, your old .htaccess file may contain rules from a different server environment. After migration:

  1. Go to Settings > Permalinks
  2. Select your preferred URL structure (for example, Post name)
  3. Click Save Changes

If you are using a custom permalink structure, note it down before flushing. The flush does not change your chosen permalink format, it just regenerates the rules that make it work.

If the Issue Persists

Check the following:

  • Confirm mod_rewrite is enabled on the server (Kapsule enables this by default)
  • Ensure the .htaccess file in your site root is writable by the web server
  • Deactivate recently installed plugins one at a time to check for conflicts

If none of these resolve the issue, open a support ticket in KPanel under Support.

Was this article helpful?

Still need help?

Our support team is here on business days, NZT.

Back to Help Centre