I just migrated (with mod rewrite) from non-friendly URLs to a bit-more-friendly URLs: from site.com/post.php?id=5 to site.com/post/the-title-of-the-post/5.This is my PHP redirect from old to new URL:if(empty($_GET['friendly']) && empty($_POST)){        include('includes/basedatos.php');        include('includes/funciones.php');        $id = (int) mysql_real_escape_string($_GET['id']);        $post = mysql_fetch_array(mysql_query(SELECT id, titulo FROM post WHERE id = $id));        $titulo = $post['titulo'];        if($titulo == ''){            header('HTTP/1.0 404 Not Found');        }        $ruta = '/post/'.urls_amigables(trim($titulo)).'/'.$id;        header ('HTTP/1.1 301 Moved Permanently'); /* please not this */        header(Location: $ruta);        exit();    }The problem here is that even I set the headers to 301 Google is warning me of duplicated titles (and descriptions) and shows me both (old and new) URLs.Question: is this a temporary stage? or I am not moving properly the my post URLs?
Friendly URL change and Google Webmaster Tools warnings
seo;google search console;url
If your requests to the old URLs are actually redirected with status 301 to the new URLs (check with Firebug or similar), Google will notice sooner or later and drop the old ones from the index.The bot has probably indexed the new pages and not (yet) checked the old URLs that are already indexed.Your headers look fine for me.Note below: ideally, you should take care that all links on the page actually use the new URLs, not sure whether this is the case.