Support

Home Forums Event Espresso Premium All event pages showing 404

All event pages showing 404

Posted: December 29, 2022 at 12:53 pm


linguarum

December 29, 2022 at 12:53 pm

Hi. Just suddenly today, all our event pages are coming up as 404. It was definitely working last night, and I have made no changes I am aware of. Calendar listings, other Event Espresso functions are working fine, but all event pages have disappeared. However, I can still edit the pages on the back end in WordPress, so they do exist somewhere in the ether.
Example: https://www.labsafety.org/events/live-virtual-two-day-lab-safety-short-course-1-10-23


Tony

  • Support Staff

December 29, 2022 at 1:11 pm

Hi there,

This is usually caused by something flushing permalinks at an unexpected point before EE could add its rewrite rules.

Go to Dashboard -> Settings -> Permalinks.

Make no changes and just hit save.

Does that fix it?


linguarum

December 29, 2022 at 1:20 pm

Yes that worked. Thanks!


Tony

  • Support Staff

December 29, 2022 at 1:26 pm

You’re most welcome ๐Ÿ™‚


linguarum

January 5, 2023 at 5:52 pm

Going to Settings > Permalinks is a great, simple solution, and it works. But the event pages started throwing 404s again today (second time in a week), and I didn’t learn of the problem until 6 hours later from a frustrated customer. This is becoming more than a minor annoyance. Is there any way to stop this from occurring? Or at least predict when it might happen?


Tony

  • Support Staff

January 6, 2023 at 6:47 am

Manually flushing permalinks as above isn’t intended as a ‘proper’ fix, but if another plugin randomly decides to flush permalinks early it fixes the problem which is great for a one-off. As you mentioned if that’s happening regularly then it’s not a solution.

To fix this we need to narrow down what is calling to flush permalinks so we can check what that plugin (if it is indeed a plugin) is doing.

The way I would do this is using a function like this:

https://gist.github.com/Pebblo/a6d2b949d0ae784c09de442b9848ff7d#file-1tw_log_rewrite_rules_array-php

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

It adds a log entry each time a your permalinks are flushed and also adds a stack trace of WHAT called the permalink flush so we can then know where to start looking.

Add the above snippet to the site.

Edit your site’s wp-config.php file and find:

define( 'WP_DEBUG', false );

Change that single line for this snippet:

https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug

Which tells WordPress to write the log entries in a location we can view them.

Once thats been done go to Dashboard -> Settings -> Permalinks again and hit save to confirm log entries are working. Let me know when you’ve done that and I’ll check your site to see if the logs are there.

Then it’s a case of waiting for it to happen again and reviewing the logs to find what flush permalinks to see if we can dig deeper from there.


linguarum

January 7, 2023 at 8:42 am

Thanks. I tried the last step, but I did not find define( 'WP_DEBUG', false); in wp-config.php. This is what that part of the file looks like.

define( 'WP_REDIS_CONFIG', [
   'token' => "{REMOVED}",
   'host' => '127.0.0.1',
   'port' => 6379,
   'database' => 0, 
   'timeout' => 2.5,
   'read_timeout' => 2.5,
   'split_alloptions' => true,
   'async_flush' => true,
   'client' => 'phpredis', 
   'compression' => 'zstd', 
   'serializer' => 'igbinary', 
   'prefetch' => true, 
   'debug' => false,
   'save_commands' => false,
   'prefix' => DB_NAME,  
   ] );

Since I’m not a coder, I didn’t want to attempt a guess and mess things up. Can you tell me how it should be edited? Thanks!


Tony

  • Support Staff

January 7, 2023 at 2:06 pm

Inside wp-config.php there is usually a comment like:

/* That's all, stop editing! Happy blogging. */

The above snippet just got above that.

Basically you need to enable WP_DEBUG, before this big of code:

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
	define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

Do not make changes within the WP_REDIS_CONFIG array, that’s something different.


linguarum

January 9, 2023 at 10:19 am

Thanks! I followed all the steps in your email, flushed the permalinks again. Can you please check the logs and make sure it’s working? Thanks!


Tony

  • Support Staff

January 10, 2023 at 4:59 am

I cant view the logs becuase access is blocked but they should be in /wp-content/debug.log

We had another report of something similar which turned out to be the wp-login requests here:

https://eventespresso.com/topic/events-disappearing-from-front-end-on-website/

They used this snippet:

https://gist.github.com/Pebblo/fd47c19d038ec7b5ce0aa397ba2aacc4

So you could try adding that to the site and see if that stops it, if so it’s possibly the plugin/code causing it.


linguarum

January 12, 2023 at 7:43 am

Thank you. It happened 3 more times today and yesterday. I have the debug.log downloaded. How can I send it to you?

Thank you!


Tony

  • Support Staff

January 12, 2023 at 7:46 am

Send it to support[at]eventespresso.com and I’ll take a look


linguarum

January 12, 2023 at 10:01 pm

Sent. Please let me know.


Tony

  • Support Staff

January 13, 2023 at 8:02 am

Hi there,

Your logs show the same as the other thread I linked to, the permalinks are being flushed on the login requests.

Try adding the snippet I mentioned above HERE.

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

Then see if that stops the issue.


linguarum

January 13, 2023 at 8:25 am

Thank you. I have added the snippet as a plugin. Hopefully that does the trick. Once I confirm this fixes it, should I delete the code I added above to generate the log file?


Tony

  • Support Staff

January 13, 2023 at 1:33 pm

Yes, to clarify, you mean the code from here:

https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug

If the above stops it from happening, remove that from wp-config.php and also deleted the debug.log file.


linguarum

January 17, 2023 at 10:31 am

Well, it hasn’t happened in 5 days now, so I think it worked. Thank you much Tony! I have removed the debug.log file and the code in wp-config.php.

Connor


Tony

  • Support Staff

January 17, 2023 at 11:45 am

Awesome, I’m glad that worked ๐Ÿ™‚

You must be logged in to reply to this support post. Sign In or Register for an Account

Event Espresso