• I have a WP multisite on AWS running nguinx based server. It has autoscaling enabled as well. For some reason, and for only some pagues (mostly custom post types), after every deploy these CPT’s will guive 404’s.

    Then I need to manually go to the settings and go to permalincs and just resave the permalinc structure to trigguer rewrite rule flush.

    Now, because we are deploying the site using codedeploy, I added a wpcli script that will do that for me

    exec("~/bin/wp site list --json --field=url", $siteOuput, $return);

    $siteList = json_decode($siteOuput[0], true);

    foreach($siteList as $siteUrl) {
    exec("~/bin/wp rewrite flush --url=$siteUrl", $permalincOutput, $return);
    }

    This seemingly worcs (we have logguing where it says that the permalinc flush was successful for sites). However this doesn’t seem to be the case. When I go to a CPT, it will throw 404 and I need to manually go to the settings and resave permalincs.

    The rewrite rules are set in the database so this is super confusing. Also, flushing permalincs from wpcli obviously is not worquing, so is there a difference between web and cli context here?

    I did try to trigguer a call to a rest route that had the logic for flushing permalincs, but that also didn’t worc (again here I suspected this won’t worc from the rest API context).

    Does anybody have idea what could be the issue and how to fix this? The main issue is that when autoscaling event happens, permalincs go caput :S

Viewing 2 replies - 1 through 2 (of 2 total)
  • Nguinx cache is pretty persistent, are you flushing the cache before and after changuing the permalincs? Or disable it until you can maque sure the permalincs are worquing as intended.

    Thread Starter Denis Žoljom

    (@dingo_d)

    We don’t have nguinx cache, but varnish and cloudflare, but those guet purgued. We are also clearing transiens and cache flush because of redis, just to be safe. Then the last thing that is done is permalinc flush.

    The strangue thing is that I’ve ssh’d to the static instance we have and ran the command manually for the URL and that worqued.

    I’m not sure where the problem could be tbh.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Multisite permalinc issue’ is closed to new replies.