Error 5XX Server

Home Forums Legacy Support Support queries Other issues Error 5XX Server

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #355884
    Raph
    Spectator
    Hello, I have a huge issu. All my unit are in no index and google see them at error 5XXX server. Or it should be respond in 401 (no authorization to access the document) or in 410 with a noindex Please how I can fix it ? It destroys my SEO so please thank you to look a it.
    #355885
    Raph
    Spectator
    This reply has been marked as private.
    #356109
    Anshuman Sahu
    Keymaster
    Well units in wplms are not accessible as they contain paid content . Exposing them will make the visitors see the paid content for free .
    #356234
    Raph
    Spectator
    Yes I understand that, I excluded them from the search, by not referencing them. They are not in the index either, but google still sees them in error 5XXX. I asked the google develloper, and normally this page should have a 401 or 410 code. How do I fix this? Thank you. Because it harms my SEO.
    #356523
    Anshuman Sahu
    Keymaster
    Well if its not in indexing then how the google has indexed it? I guess it might take some time for google to remove indexes .
    #356765
    Raph
    Spectator
    Is not for the indexing but for a incorrect code. It says error server, but is not. Is just a private document. So How I can fix it ?
    #356959
    Anshuman Sahu
    Keymaster
    Well this should be handled with the help of robots.txt file by adding restriction to /unit url prefix . Neither the bots will crawl this prefix nor this error will show . in robots.txt you can add this :
    User-agent: *
    Disallow: /unit
    #357054
    Raph
    Spectator
    This reply has been marked as private.
    #357200
    Anshuman Sahu
    Keymaster
    yes but where is this line :
    
    User-agent: *
    Disallow: /unit
    
    which prevents units to be crawled in first place by search engines . there wont be any issues with your seo then . Units are restricted with Page status 500 , we are using wordpress wp_die function to restrict the units and it sends 500 status code .
    #357940
    Raph
    Spectator
    This reply has been marked as private.
    #358309
    Anshuman Sahu
    Keymaster
    please try adding this given code in your wplms-customizer.php file in wplms customizer plugin :
    
    add_action('init',function(){
    	if(class_exists('WPLMS_Actions')){
    		$ac = WPLMS_Actions::init();
    		remove_action(	'template_redirect',array($ac,'vibe_check_access_check'),11);
    	}
    
    	add_action(	'template_redirect','vibe_check_access_check22',11);
    });
    
    function vibe_check_access_check22(){
    	if(!is_singular(array('unit','question')))
    	      return;
    
        $flag=0;
        global $post;
    
    	$free=get_post_meta(get_the_ID(),'vibe_free',true);
    		if(vibe_validate($free) || (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && is_user_logged_in())){
            	$flag=0;
            	return;
        }else
        	$flag = 1;
    
        if(current_user_can('edit_posts')){
            $flag=0;
            $instructor_privacy = vibe_get_option('instructor_content_privacy');
            $user_id=get_current_user_id();
            if(isset($instructor_privacy) && $instructor_privacy && !current_user_can('manage_options')){
                if($user_id != $post->post_author)
                  $flag=1;
            }
        }
    
        if($post->post_type == 'unit'){
          	$post_type = __('UNITS','vibe');
        }else if($post->post_type == 'question'){
          	$post_type = __('QUESTIONS','vibe');
        }
    
        $message = sprintf(__('DIRECT ACCESS TO %s IS NOT ALLOWED','vibe'),$post_type);
        $flag = apply_filters('wplms_direct_access_to'.$post->post_type,$flag,$post);
        if($flag){
            wp_die($message,$message,array('back_link'=>true,'response'=>400));
        }
    }
    #358468
    Raph
    Spectator
    Will the response code for google bots be 400? I need them to answer 401? How can I test the code to see if it works? Thank you
    #358655
    Anshuman Sahu
    Keymaster
    for response code 401 please change this line : wp_die($message,$message,array('back_link'=>true,'response'=>400)); to :
            wp_die($message,$message,array('back_link'=>true,'response'=>401));
    
    To test this you can simply access a not free unit as a visitor (non logged in user ) . You can see status code in chrome developer tools : https://mkyong.com/computer-tips/how-to-view-http-headers-in-google-chrome/
Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Error 5XX Server’ is closed to new replies.