I know this wont be so precizely written, but I cant describe it any better. Im in admin, and I pressed the save button on "permalinks option".

I have an article: www.example.com/video/title which then will lead to the main page (just showing, not redirected!).

But as soon as I make this in init action: $_GLOBALS['wp_rewrite']->flush_rules(true); it starts working immediatly!

But I didnt change anything on rewrite rules! So how or when could it be modified?

  • 2
    Note that you shouldn't need to flush rewrite rules on every page load, it's enough to just go to the permalinks settings page and save to flush rewrite rules. Was this article the first post in a new custom post type? – Tom J Nowell Sep 4 at 14:52
  • nope, it wasn't – John Smith Sep 5 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.