WordPress.org

Ready to get started?Download WordPress

Forums

Permalink 404 error with /%year%/%monthnum%/%postname%/ as default (4 posts)

  1. mmacfadden
    Member
    Posted 1 year ago #

    I am using the YD Network-wide options plugin and have set my "Master" site permalinks to use the /%year%/%monthnum%/%postname%/ structure.

    My "slave" sites inherit the permalink setting, but when I click the first default post, I receive a 404 error. If I go into the permalink settings of the "slave" site and simply click the "Save changes" button (with /%year%/%monthnum%/%postname%/ already selected), the 404 error issue goes away.

    If I set my master to use this permalink structure: /%year%/%monthnum%/%day%/%postname%/ I don't get the 404 error.

    I don't want my users to have to mess with permalink settings, and I'd rather not include /%day%/ in the URL.

    Other posts related to this issue lead me to believe this may be an .htaccess issue, so here is my code for that:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    You can view this issue live at the following site: http://flashdraft.org/lorem/

    Click the link called "Sample Assignment"

    Thanks for your help!

  2. Does it work if you resave without make any changes? It almost sounds like there's a hitch in the permalinks in the DB.

  3. mmacfadden
    Member
    Posted 1 year ago #

    You are correct. I don't make any changes, but I do resave and it starts working. Any thoughts on how to fix the permalinks DB hitch?

    Thanks again!

  4. I believe, in the wp_x_options table, you have permalink_structure

    That's what sounds like it's not getting set right.

Topic Closed

This topic has been closed to new replies.

About this Topic