• Resolved Theo Pape

    (@theo38)


    Hi there,

    For some reason, 301 redirects are added by your plugin even to the core files. i.e. wp-cron.php

    Never cache the following pages:
    wp-.*\.php
    index\.php

    are set. The issue with this, is that we are trying to access the cron locally, but every time the file is called, it gets the 301 redirect to the web domain, which is what we are trying to block using an AWS ELB rule, so that the cron can’t be triggered externally. By disabling the plugin, the redirect is removed. By disabling page cache part of the plugin, the redirect is removed.

    Please let me know if this is a bug, or if there is another way to filter this file out of the 301 redirect?

    Thanks,
    Theo

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Theo Pape

    (@theo38)

    The issue appears to come from this function which you have an action for add_action( ‘init’, array( $this, ‘redirect_on_foreign_domain’ ) ); – can’t seem to find a way of removing this if URL is/contains /wp-cron.php

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @theo38

    Thank you for reaching out and I am happy to assist you with this.

    This is an expected behavior because you are trying to access the WordPress website by the IP, and not its home domain.
    You can make your own PHP script for a health check if you want to load wp core there – rewrite the host first by?$_SERVER['HTTP_HOST'] = 'my-blog-host.com';

    The problem is that health check doesn’t only checks if the site still renders, it checks internal HTTP request of internal IP renders something similar to the site”, and this is not equal.
    It’s a bit of a grey zone, and while it appears valid – there are several severe reasons why it’s not like for SEO, properties of WP behavior for similar requests for WPMU, and of course, caching
    The only workaround and the solution for this is shared above – rewrite the host first.

    Thanks!

    Thread Starter Theo Pape

    (@theo38)

    Doesn’t really address the issue…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Plugin adding 301 redirects to ‘Never cache the following pages’ files’ is closed to new replies.