• Migrated to WP several months ago. 404 errors just keep on increasing (now at 34,000). Redirected via htaccess but 404 errors remain.

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(es|en|de)/.+-([0-9]+)\.html$ ?antiguoID=$2&antiguoLANG=$1 [L]

    en php (/wp-content/themes/citygonow/header.php):
    if(isset($_GET[‘antiguoID’]) && isset($_GET[‘antiguoLANG’])){
    $antID=$_GET[‘antiguoID’];
    $antLANG=$_GET[‘antiguoLANG’];

    $match=$wpdb->get_results(‘select det.post_id from cgn_detalles det where oldid=’.$antID);
    if($match){
    $newID=$match[0]->post_id;
    if($antLANG!=’es’){
    $newID=icl_object_id($newID, get_post_type($newID, false, $antLANG));
    }
    $npguid=get_permalink($newID);
    header(“Location: “.$npguid, true, 301);
    exit;
    }else{
    header(“HTTP/1.0 410 Gone”);
    header(“Status: 410”);
    echo “removed content”;
    exit;
    }
    }

    WPEngine suggests we go to a plugin.

    Any suggestions ?

  • The topic ‘404 Errors keep increasing’ is closed to new replies.