When settings custom permalink structures in your WordPress settings make sure to
- either make .htaccess writeable by your webserver so that when saving your custom structure via the backend WordPress will automatically update your .htaccess too
- 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:
- open options table from database and locate the permalink_structure field
- clear its value and save the entry
- remove the above mod_rewrite content from .htaccess
- make .htaccess writeable by your webserver
- reload your backend URL (/wp-admin)
This way you can reset your permalink structure to “Default” setting and start over again.
