Sitemap.php Pero google no lo acepto, después con htaccess cambie la extensión a sitemap.xml pero google tampoco lo quiso, ¿Qué puedo hacer?
Aqui esta el codigo que utilizo:
Código PHP:
<?php
include('conexion.php');
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<urlset
xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">
";
echo "<url><loc>$web</loc></url>\n";
$query_usuarios= mysql_query("SELECT *FROM $table_usuarios order by id DESC");
while($user= mysql_fetch_array($query_usuarios))
{echo "<url><loc>$web/$user[nombre].html</loc></url>\n";}
$query_preguntas= mysql_query("SELECT *FROM $table_preguntas order by id DESC");
while($id_preguntas= mysql_fetch_array($query_preguntas))
{echo "<url><loc>$web/Pregunta$id_preguntas[id]/</loc></url>\n";}
$query_tutorial= mysql_query("SELECT *FROM $table_tutorial order by id DESC");
while($id_tutorial= mysql_fetch_array($query_tutorial))
{echo "<url><loc>$web/tutorial/$id_tutorial[tipo]/$id_tutorial[id]/</loc></url>\n";}
echo "</urlset>";
?>