• Resolved adobehills

    (@adobehills)


    Hello Members team,

    I use members and I like it, because it is a really helpful plugin. Members provides also a button to activate private website. This was great, because I have had another plugin for this which I removed.

    Since some weeks I have performance problems because some bots like my site ?? . Every time they get the redirect to the login page. ??

    Is it possible to redirect them to a specific page on my website which is not restricted? Or give them only a simple message, that they have to login? So not every of my 900000 page accesses from bots go to the login page?

    Thank you so much in advance

    kind regards

    Karl

Viewing 1 replies (of 1 total)
  • Plugin Author Caseproof

    (@caseproof)

    Hi @adobehills

    Unfortunately, we don’t have any options for bots. The only workaround would be to replace the private site with a custom code similar to this:

    add_action( 'template_redirect', function() {
    	// Add the list of custom pages below that you want to protect
    	if(!is_page( array('about'))) { return; }
    	if(current_user_can('manage_options')) { return; }
    
    	global $post;
    	if ( ! members_can_current_user_view_post( $post->ID ) ) {
    		$redirect = 'https://your-domain.com/about.php'; // Change this to the correct page that is not protected
    		wp_redirect( $redirect );
    		exit;
    	}
    } );

    It protects each page except the one in the 3rd line for not authorized users.

    I hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Performance impact, because of redirect to Login Page’ is closed to new replies.