• Resolved markpochtarev

    (@markpochtarev)


    Hi!
    We have a site with different home_url and site_url (domains are different). Once we publish a page with post_status private, it has an infinite redirect loop on front end

    But if site_url and home_url are the same, then everything is working fine

    Could you please check the case where we have different site and home urls and we published private page

    Thanks in advance for any help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Maciej Bis

    (@mbis)

    Hi @markpochtarev,

    Could you try to add ?debug_redirect=1 and ?debug_wp_redirect to the end of URL and send me screenshots with the displayed debug data?

    Best regards,
    Maciej

    Thread Starter markpochtarev

    (@markpochtarev)

    debug_redirect:

    debug_wp_redirect:

    Plugin Author Maciej Bis

    (@mbis)

    Hi @markpochtarev,

    Unfortunately, the screenshots are not displayed correctly. Please try to upload them to some image hosting, e.g. Imgur.com

    Thread Starter markpochtarev

    (@markpochtarev)

    Last three screenshots at the bottom are from ?debug_wp_redirect
    https://imgur.com/a/OTqcZmG

    Plugin Author Maciej Bis

    (@mbis)

    Thank you, now I see the bug clearly. The issue will be addressed in the next version of the plugin. To hotfix it, until new version is released please use this code snippet:

    function pm_disable_private_redirect( $correct_permalink, $redirect_type, $queried_object, $old_uri ) {
    	if ( ! empty( $queried_object->post_status ) && $queried_object->post_status == 'private' ) {
    		return false;
    	}
    
    	return $correct_permalink;
    }
    add_filter( 'permalink_manager_filter_redirect', 'pm_disable_private_redirect', 0, 4 );
    Thread Starter markpochtarev

    (@markpochtarev)

    Maciej Bis Thank you for your help and quick response!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Infinite redirect loop for private pages with different home/site url’ is closed to new replies.