<?
include("includes/DB_Conectar.php");

$url = $_SERVER["REQUEST_URI"];
$a = explode("/",$url);

//print_r($a);die();
$name = mysql_real_escape_string($a[1]);

$aux = $conn->getRecordset("SELECT id FROM contenidos WHERE url_wp = '".$name."'");

if(count($aux)==1)
{
	$UrlNota = buildContenidoLinkFromRoot($aux[0]["id"], "HTML");
	header("Location: ".$UrlNota);
	die();
}
else
{
	header("Location: index.php");
	die();
}

?>