Tag: custom

  • Custom WordPress Permalinks Are Causing 403 or 404 Errors

    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.