Howto Cron with htaccess

I’m struggling with setting cron jobs.

My MainWP is behind htaccess.

I entered cron jobs in my admin panel, but I don’t see any results in my dashboard. I hoped to the website sync done by cron, but in my dashboard I have the message:

“Update overview
Last synchronization completed successfully: October 23, 2023 4:16 p.m”

I don’t find the information about which cron is doing the right thing. I checked this page:

Hi @KnallBlauMedia

Welcome to the MainWP community!

It’s possible that security rules in .htaccess are blocking the server side cron jobs.

Can you contact the support of the host where you MainWP Dashboard is located and have them check if there are any blocked requests for cron jobs?

The cron job “Check for available updates” is the equivalent of performing the Sync on the Dashboard.

But please keep in mind that if you use server-side cron jobs, you have to disable WP Cron in the MainWP Dashboard as instructed in this KB: Disable WP Cron - MainWP Documentation

And that after you do so, you won’t be able to rely on messages like these “Update overview
Last synchronization completed successfully: October 23, 2023 4:16 p.m” in your Dashboard.
Those logs are only for when the WP Cron is in use and not server-side cron.

Thx!

If I get the original WP Cron running, this one solves every problem with MainWP?

On Cron for WordPress | WordPress Developer's Guide I found 15 minutes as an interval. Is that enough for MainWP?

Not quite sure what you’re referring to when you say, “solves every problem with MainWP?”, but if you were to go with the WP-Cron, then .htacess protection would not be an issue.

So, with that in mind, using WP-Cron may be an easier solution.

And if the scheduled events are not occurring while using WP-Cron, please refer to this KB: https://kb.mainwp.com/docs/scheduled-events-not-occurring/

If you would use WP Cron, then setting up time intervals is not necessary. And for server-side cron jobs, the recommended time intervals are stated in our KB: Disable WP Cron - MainWP Documentation

I think, I got it.

If your MainWP is behind htaccess you should use WP Cron HTTP Auth – WordPress-Plugin | WordPress.org Deutsch to get wp-cron.php reachable. And after a message to my hosting about logs, they changed some settings. Now I see in Cron Logger – WordPress-Plugin | WordPress.org Deutsch the running Cron

1 Like

It’s great to hear that you’ve managed to find a solution, and thanks for updating the community.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.