Custom WordPress Permalinks Are Causing 403 or 404 Errors

When settings custom permalink structures in your WordPress settings make sure to

  1. either make .htaccess writeable by your webserver so that when saving your custom structure via the backend WordPress will automatically update your .htaccess too
  2. or manually edit your .htaccess file with the minimal required mod_rewrite rules as shown below, right after setting your custom permalink structure via the backend
# 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

Also, make sure that your RewriteBase setting is correct.

Hint:
In case you experience 403/404 errors after setting your custom permalink structure here is what you can do:

  1. open options table from database and locate the permalink_structure field
  2. clear its value and save the entry
  3. remove the above mod_rewrite content from .htaccess
  4. make .htaccess writeable by your webserver
  5. reload your backend URL (/wp-admin)

This way you can reset your permalink structure to “Default” setting and start over again.

You may also like...

1 Response

  1. Thank you. You helped me to solve my problem.
    I had set a wrong RewriteBase for my blog. Now it is working.
    I think I would have searched days without your tip.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.