straube/multiple-domain

Redirect to original domain (without https)

Closed this issue · 3 comments

WP: 5.1.1
MD: 0.11.0+
Last working MD version: 0.10.3

My wp redirects at the template_redirect around prio 10, with version 0.11.0 and above.

Test details (settings was 2 domains, base path empty, others default):
1.
v0.11.0+
add_action('template_redirect', function(){die;}, 9, 0);
Result: White screen without redirect. (Working, because stopped before the redirect.)
2.
v0.11.0+
add_action('template_redirect', function(){die;}, 10, 0);
Result: White screen with redirect to the main domain. (This is the problem!)
3.
v0.10.3
no action added
Result: White screen without redirect. (Works well.)

Hello @hkodavid,

The plugin is not supposed to directly affect template_redirect action, which is a WordPress action. In any way, I'll try to reproduce to make sure there is something I can do to avoid that side effect.

Thanks for the report.

@hkodavid I ran the following tests in a fresh WordPress installation with no plugins installed except Multiple Domain:

add_action('template_redirect', function() {
    echo 'foo';
    exit();
}, 9, 0);
add_action('template_redirect', function() {
    echo 'foo';
    exit();
}, 10, 0);
add_action('template_redirect', function() {
    echo 'foo';
    exit();
}, 11, 0);

Notice the only change between each test is the action priority (9 to 11). All of them gave me the same results. A screen displaying foo, only. The tests were consistent with 0.10.3.

Maybe the issue was fixed on 0.11.2, which was released last week, or there is a conflict with another plugin/theme. Could you try to upgrade the plugin and check if that works. In case that didn't resolve the bug, there is a way for you to make sure the problem is directly related to Multiple Domain?

I ran a test on the same wp after updated to v0.11.2 and worked well! Thanks!