evet php yönlendirme ama sorunu bulamadım

sitemap.php

<?php require_once('Connections/config.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_config, $config);
$query_url = "SELECT * FROM site_dili";
$url = mysql_query($query_url, $config) or die(mysql_error());
$row_url = mysql_fetch_assoc($url);
$totalRows_url = mysql_num_rows($url);

mysql_select_db($database_config, $config);
$query_kurumsal = "SELECT * FROM kurumsal ORDER BY id DESC";
$kurumsal = mysql_query($query_kurumsal, $config) or die(mysql_error());
$row_kurumsal = mysql_fetch_assoc($kurumsal);
$totalRows_kurumsal = mysql_num_rows($kurumsal);

mysql_select_db($database_config, $config);
$query_hizmetler = "SELECT * FROM hizmetler ORDER BY id DESC";
$hizmetler = mysql_query($query_hizmetler, $config) or die(mysql_error());
$row_hizmetler = mysql_fetch_assoc($hizmetler);
$totalRows_hizmetler = mysql_num_rows($hizmetler);

mysql_select_db($database_config, $config);
$query_kategori = "SELECT * FROM proje_kategorileri ORDER BY id DESC";
$kategori = mysql_query($query_kategori, $config) or die(mysql_error());
$row_kategori = mysql_fetch_assoc($kategori);
$totalRows_kategori = mysql_num_rows($kategori);

mysql_select_db($database_config, $config);
$query_projeler = "SELECT * FROM projeler ORDER BY id DESC";
$projeler = mysql_query($query_projeler, $config) or die(mysql_error());
$row_projeler = mysql_fetch_assoc($projeler);
$totalRows_projeler = mysql_num_rows($projeler);

mysql_select_db($database_config, $config);
$query_haberler = "SELECT * FROM haberler ORDER BY id DESC";
$haberler = mysql_query($query_haberler, $config) or die(mysql_error());
$row_haberler = mysql_fetch_assoc($haberler);
$totalRows_haberler = mysql_num_rows($haberler);

mysql_select_db($database_config, $config);
$query_iletisim = "SELECT * FROM ayarlar_iletisim_bilgileri ORDER BY id DESC";
$iletisim = mysql_query($query_iletisim, $config) or die(mysql_error());
$row_iletisim = mysql_fetch_assoc($iletisim);
$totalRows_iletisim = mysql_num_rows($iletisim);

header("Content-type: text/xml");
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">

<url>
<loc><?php echo $row_url['url']; ?></loc>
<changefreq>always</changefreq>
</url>
<url>
<loc><?php echo $row_url['url']; ?>hizmetler</loc>
<changefreq>always</changefreq>
</url>
<url>
<loc><?php echo $row_url['url']; ?>haberler</loc>
<changefreq>always</changefreq>
</url>
<url>
<loc><?php echo $row_url['url']; ?>foto-galeri</loc>
<changefreq>always</changefreq>
</url>
<url>
<loc><?php echo $row_url['url']; ?>video-galeri</loc>
<changefreq>always</changefreq>
</url>
<?php do { ?>
<url>
<loc><?php echo $row_url['url']; ?>kurumsal-<?php echo $row_kurumsal['id']; ?>-<?php echo permalink($row_kurumsal['baslik']); ?></loc>
<changefreq>always</changefreq>

</url>
<?php } while ($row_kurumsal = mysql_fetch_assoc($kurumsal)); ?>

<?php do { ?>
<url>
<loc><?php echo $row_url['url']; ?>hizmet-<?php echo $row_hizmetler['id']; ?>-<?php echo permalink($row_hizmetler['baslik']); ?></loc>
<changefreq>always</changefreq>

</url>
<?php } while ($row_hizmetler = mysql_fetch_assoc($hizmetler)); ?>
<?php do { ?>
<url>
<loc><?php echo $row_url['url']; ?>kategori-<?php echo $row_kategori['id']; ?>-<?php echo permalink($row_kategori['baslik']); ?></loc>
<changefreq>always</changefreq>

</url>
<?php } while ($row_kategori = mysql_fetch_assoc($kategori)); ?>
<?php do { ?>
<url>
<loc><?php echo $row_url['url']; ?>proje-<?php echo $row_projeler['id']; ?>-<?php echo permalink($row_projeler['baslik']); ?></loc>
<changefreq>always</changefreq>

</url>
<?php } while ($row_projeler = mysql_fetch_assoc($projeler)); ?>
<?php do { ?>
<url>
<loc><?php echo $row_url['url']; ?>haber-<?php echo $row_haberler['id']; ?>-<?php echo permalink($row_haberler['baslik']); ?></loc>
<changefreq>always</changefreq>

</url>
<?php } while ($row_haberler = mysql_fetch_assoc($haberler)); ?>
<?php do { ?>
<url>
<loc><?php echo $row_url['url']; ?>iletisim-<?php echo $row_iletisim['id']; ?>-<?php echo permalink($row_iletisim['baslik']); ?></loc>
<changefreq>always</changefreq>

</url>
<?php } while ($row_iletisim = mysql_fetch_assoc($iletisim)); ?>

</urlset>
<?php
mysql_free_result($url);

mysql_free_result($kurumsal);

mysql_free_result($hizmetler);

mysql_free_result($kategori);

mysql_free_result($projeler);

mysql_free_result($haberler);

mysql_free_result($iletisim);
?>