Reciving Error 404 blog/page/2/

function wphelp_custom_pre_get_posts( $query ) {
if( $query->is_main_query() && !$query->is_feed() && !is_admin() && is_category()) {
    $query->set( 'paged', str_replace( "https://wordpress.stackexchange.com/", '', get_query_var( 'page' ) ) );  }  }
add_action('pre_get_posts','wphelp_custom_pre_get_posts');
function wphelp_custom_request($query_string ) {
     if( isset( $query_string['page'] ) ) {
         if( ''!=$query_string['page'] ) {
             if( isset( $query_string['name'] ) ) { unset( $query_string['name'] ); } } } return $query_string; }
add_filter('request', 'wphelp_custom_request'); 

I have used this code and it helped me through for now.