wp-cron.php gets redirected
-
When I curl my website’s wp-cron.php file it gets redirected by Redirection. Because some code runs before the redirect gets triggered, it sets the DOING_CRON constant to true (wp-cron.php line 42) which persists through the redirect and then runs into wp-cron.php line 33
if ( ! empty( $_POST ) || defined( ‘DOING_AJAX’ ) || defined( ‘DOING_CRON’ ) ) {
die();
}
where it dies since DOING_CRON is already defined.
This only happens in my production environment where Redirection is configured to redirect to https and also to www subdomain where the cron job is configured to http protocol and the root domain.
I have added a filter hook for redirection_url_target into my functions.php and it didn’t seem to even get triggered. I haven’t spent enough time confirming but my assumption is that the redirect happens before functions.php is loaded, in which case I would need to move the hook to a plugin.
Any suggestions are appreciated, thanks!
- You must be logged in to reply to this topic.