• 24-03-2024, 18:13:39
    #1
    <?php
    
    include'sistem/baglan.php';  
    
    $ilanlar = $vt->query("select * from emlak_ilan")->fetchAll();
    $bloglar = $vt->query("select * from blog")->fetchAll();  
    $haberler = $vt->query("select * from haber")->fetchAll();  
    $sayfalar = $vt->query("select * from sayfa")->fetchAll();  
    $tarih=date('d.m.Y');
    
    ?>
    
    <?php header('Content-type: Application/xml; charset="utf8"', true); ?>
    <urlset
            xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:xhtml="http://www.w3.org/1999/xhtml"
            xsi:schemaLocation="
                http://www.sitemaps.org/schemas/sitemap/0.9
                http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
    
    <?php foreach($ilanlar AS $emlak) { ?>
        
    <url>
    <loc><?php echo $ayar["site_url"]; ?><?php echo $emlak["seo"]; ?>-<?php echo $emlak["emlakno"]; ?>-ilan-<?php echo $emlak["id"]; ?></loc>
    <lastmod><?php echo $emlak["eklemetarihi"]; ?></lastmod>
    <changefreq>daily</changefreq>
    <priority>0.5000</priority>
    </url>
    <?php } ?>
    
    <?php foreach($bloglar AS $blog) { ?>
        
    <url>
    <loc><?php echo $ayar["site_url"]; ?><?=$blog["seo"];?>-blog-<?=$blog["id"];?></loc>
    <lastmod><?php echo $blog["tarih"]; ?></lastmod>
    <changefreq>daily</changefreq>
    <priority>0.5000</priority>
    </url>
    <?php } ?>
    
    <?php foreach($haberler AS $haber) { ?>
        
    <url>
    <loc><?php echo $ayar["site_url"]; ?><?=$haber["seo"];?>-haber-<?=$haber["id"];?></loc>
    <lastmod><?php echo $haber["tarih"]; ?></lastmod>
    <changefreq>daily</changefreq>
    <priority>0.5000</priority>
    </url>
    <?php } ?>
    
    <?php foreach($sayfalar AS $sayfa) { ?>
        
    <url>
    <loc><?php echo $ayar["site_url"]; ?><?=$sayfa["seo"];?>-sayfa-<?=$sayfa["id"];?></loc>
    <lastmod><?php echo $tarih; ?></lastmod>
    <changefreq>daily</changefreq>
    <priority>0.5000</priority>
    </url>
    <?php } ?>
    
    </urlset>
    sitede sitemap.php bu şekilde fakat site yer alan içerikler kısmı google tarafından index almıyor ve google search konsolda şu hatayı vermekte
    Geçersiz bir tarih bulundu. Yeniden göndermeden önce lütfen tarihi veya biçimlendirmeyi düzeltin.
    Örnekler
    Satır 13
    Ana etiket:
    url
    Etiket:
    lastmod
    Satır 20
    Ana etiket:
    url
    Etiket:
    lastmod
    Satır 27
    Ana etiket:
    url
    Etiket:
    lastmod


    eklenemeyen 46 sayfa uyarısı vermekte bende şu şekilde değiştirdim

    <?php
    
    include 'sistem/baglan.php';
    
    $ayarlar = $vt->query("SELECT * FROM ayarlar WHERE id = 1")->fetch(PDO::FETCH_ASSOC);
    
    $ilanlar = $vt->query("SELECT * FROM emlak_ilan WHERE aktif = 1 ORDER BY tarih_ekleme DESC")->fetchAll(PDO::FETCH_ASSOC);
    $bloglar = $vt->query("SELECT * FROM blog WHERE aktif = 1 ORDER BY tarih_yayin DESC")->fetchAll(PDO::FETCH_ASSOC);
    $haberler = $vt->query("SELECT * FROM haber WHERE aktif = 1 ORDER BY tarih_yayin DESC")->fetchAll(PDO::FETCH_ASSOC);
    $sayfalar = $vt->query("SELECT * FROM sayfa WHERE aktif = 1 ORDER BY tarih_guncelleme DESC")->fetchAll(PDO::FETCH_ASSOC);
    
    header('Content-type: Application/xml; charset="utf8"', true);
    
    ?>
    
    <urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xsi:schemaLocation="
        http://www.sitemaps.org/schemas/sitemap/0.9
        http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
    
    <?php foreach ($ilanlar AS $emlak) { ?>
    
      <url>
        <loc><?php echo $ayarlar["site_url"]; ?><?php echo $emlak["seo"]; ?>-<?php echo $emlak["emlakno"]; ?>-ilan-<?php echo $emlak["id"]; ?></loc>
        <lastmod><?php echo date('Y-m-d', strtotime($emlak["tarih_ekleme"])); ?></lastmod>
        <changefreq>daily</changefreq>
        <priority>0.5000</priority>
      </url>
    <?php } ?>
    
    <?php foreach ($bloglar AS $blog) { ?>
    
      <url>
        <loc><?php echo $ayarlar["site_url"]; ?><?=$blog["seo"]; ?>-blog-<?=$blog["id"]; ?></loc>
        <lastmod><?php echo date('Y-m-d', strtotime($blog["tarih_yayin"])); ?></lastmod>
        <changefreq>daily</changefreq>
        <priority>0.5000</priority>
      </url>
    <?php } ?>
    
    <?php foreach ($haberler AS $haber) { ?>
    
      <url>
        <loc><?php echo $ayarlar["site_url"]; ?><?=$haber["seo"]; ?>-haber-<?=$haber["id"]; ?></loc>
        <lastmod><?php echo date('Y-m-d', strtotime($haber["tarih_yayin"])); ?></lastmod>
        <changefreq>daily</changefreq>
        <priority>0.5000</priority>
      </url>
    <?php } ?>
    
    <?php foreach ($sayfalar AS $sayfa) { ?>
    
      <url>
        <loc><?php echo $ayarlar["site_url"]; ?><?=$sayfa["seo"]; ?>-sayfa-<?=$sayfa["id"]; ?></loc>
        <lastmod><?php echo date('Y-m-d', strtotime($sayfa["tarih_guncelleme"])); ?></lastmod>
        <changefreq>daily</changefreq>
        <priority>0.5000</priority>
      </url>
    <?php } ?>
    
    </urlset>
    bu şekilde düzenledim fakat istediğim şu şekilde siteadi.com/kategori/satilik /kategori/kiralik gibi tüm içerikleri sitemap çekmesi nasıl bir düzenleme yapabilirim benim yaptığım düzenleme doğrumu yada nasıl yapabilirim ücretli yada ücretsiz olarak yardım istiyorum bu konuda
  • 27-03-2024, 00:48:16
    #2
    Buradaki bilgiden yola çıkarak tarih formatınızın hatalı olduğu kanısına vardım.

    https://stackoverflow.com/questions/...ap-date-format

    Yine aynı bilgilerden yola çıkarak, Doğru formatı şu şekilde elde edebilirsiniz:
    echo date('Y-m-dTH:i:sP', time());
    webmasterdestek adlı üyeden alıntı: mesajı görüntüle
    <?php
    
    include'sistem/baglan.php';  
    
    $ilanlar = $vt->query("select * from emlak_ilan")->fetchAll();
    $bloglar = $vt->query("select * from blog")->fetchAll();  
    $haberler = $vt->query("select * from haber")->fetchAll();  
    $sayfalar = $vt->query("select * from sayfa")->fetchAll();  
    $tarih=date('d.m.Y');
    
    ?>
    
    <?php header('Content-type: Application/xml; charset="utf8"', true); ?>
    <urlset
            xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:xhtml="http://www.w3.org/1999/xhtml"
            xsi:schemaLocation="
                http://www.sitemaps.org/schemas/sitemap/0.9
                http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
    
    <?php foreach($ilanlar AS $emlak) { ?>
        
    <url>
    <loc><?php echo $ayar["site_url"]; ?><?php echo $emlak["seo"]; ?>-<?php echo $emlak["emlakno"]; ?>-ilan-<?php echo $emlak["id"]; ?></loc>
    <lastmod><?php echo $emlak["eklemetarihi"]; ?></lastmod>
    <changefreq>daily</changefreq>
    <priority>0.5000</priority>
    </url>
    <?php } ?>
    
    <?php foreach($bloglar AS $blog) { ?>
        
    <url>
    <loc><?php echo $ayar["site_url"]; ?><?=$blog["seo"];?>-blog-<?=$blog["id"];?></loc>
    <lastmod><?php echo $blog["tarih"]; ?></lastmod>
    <changefreq>daily</changefreq>
    <priority>0.5000</priority>
    </url>
    <?php } ?>
    
    <?php foreach($haberler AS $haber) { ?>
        
    <url>
    <loc><?php echo $ayar["site_url"]; ?><?=$haber["seo"];?>-haber-<?=$haber["id"];?></loc>
    <lastmod><?php echo $haber["tarih"]; ?></lastmod>
    <changefreq>daily</changefreq>
    <priority>0.5000</priority>
    </url>
    <?php } ?>
    
    <?php foreach($sayfalar AS $sayfa) { ?>
        
    <url>
    <loc><?php echo $ayar["site_url"]; ?><?=$sayfa["seo"];?>-sayfa-<?=$sayfa["id"];?></loc>
    <lastmod><?php echo $tarih; ?></lastmod>
    <changefreq>daily</changefreq>
    <priority>0.5000</priority>
    </url>
    <?php } ?>
    
    </urlset>
    sitede sitemap.php bu şekilde fakat site yer alan içerikler kısmı google tarafından index almıyor ve google search konsolda şu hatayı vermekte
    Geçersiz bir tarih bulundu. Yeniden göndermeden önce lütfen tarihi veya biçimlendirmeyi düzeltin.
    Örnekler
    Satır 13
    Ana etiket:
    url
    Etiket:
    lastmod
    Satır 20
    Ana etiket:
    url
    Etiket:
    lastmod
    Satır 27
    Ana etiket:
    url
    Etiket:
    lastmod


    eklenemeyen 46 sayfa uyarısı vermekte bende şu şekilde değiştirdim

    <?php
    
    include 'sistem/baglan.php';
    
    $ayarlar = $vt->query("SELECT * FROM ayarlar WHERE id = 1")->fetch(PDO::FETCH_ASSOC);
    
    $ilanlar = $vt->query("SELECT * FROM emlak_ilan WHERE aktif = 1 ORDER BY tarih_ekleme DESC")->fetchAll(PDO::FETCH_ASSOC);
    $bloglar = $vt->query("SELECT * FROM blog WHERE aktif = 1 ORDER BY tarih_yayin DESC")->fetchAll(PDO::FETCH_ASSOC);
    $haberler = $vt->query("SELECT * FROM haber WHERE aktif = 1 ORDER BY tarih_yayin DESC")->fetchAll(PDO::FETCH_ASSOC);
    $sayfalar = $vt->query("SELECT * FROM sayfa WHERE aktif = 1 ORDER BY tarih_guncelleme DESC")->fetchAll(PDO::FETCH_ASSOC);
    
    header('Content-type: Application/xml; charset="utf8"', true);
    
    ?>
    
    <urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xsi:schemaLocation="
        http://www.sitemaps.org/schemas/sitemap/0.9
        http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
    
    <?php foreach ($ilanlar AS $emlak) { ?>
    
      <url>
        <loc><?php echo $ayarlar["site_url"]; ?><?php echo $emlak["seo"]; ?>-<?php echo $emlak["emlakno"]; ?>-ilan-<?php echo $emlak["id"]; ?></loc>
        <lastmod><?php echo date('Y-m-d', strtotime($emlak["tarih_ekleme"])); ?></lastmod>
        <changefreq>daily</changefreq>
        <priority>0.5000</priority>
      </url>
    <?php } ?>
    
    <?php foreach ($bloglar AS $blog) { ?>
    
      <url>
        <loc><?php echo $ayarlar["site_url"]; ?><?=$blog["seo"]; ?>-blog-<?=$blog["id"]; ?></loc>
        <lastmod><?php echo date('Y-m-d', strtotime($blog["tarih_yayin"])); ?></lastmod>
        <changefreq>daily</changefreq>
        <priority>0.5000</priority>
      </url>
    <?php } ?>
    
    <?php foreach ($haberler AS $haber) { ?>
    
      <url>
        <loc><?php echo $ayarlar["site_url"]; ?><?=$haber["seo"]; ?>-haber-<?=$haber["id"]; ?></loc>
        <lastmod><?php echo date('Y-m-d', strtotime($haber["tarih_yayin"])); ?></lastmod>
        <changefreq>daily</changefreq>
        <priority>0.5000</priority>
      </url>
    <?php } ?>
    
    <?php foreach ($sayfalar AS $sayfa) { ?>
    
      <url>
        <loc><?php echo $ayarlar["site_url"]; ?><?=$sayfa["seo"]; ?>-sayfa-<?=$sayfa["id"]; ?></loc>
        <lastmod><?php echo date('Y-m-d', strtotime($sayfa["tarih_guncelleme"])); ?></lastmod>
        <changefreq>daily</changefreq>
        <priority>0.5000</priority>
      </url>
    <?php } ?>
    
    </urlset>
    bu şekilde düzenledim fakat istediğim şu şekilde siteadi.com/kategori/satilik /kategori/kiralik gibi tüm içerikleri sitemap çekmesi nasıl bir düzenleme yapabilirim benim yaptığım düzenleme doğrumu yada nasıl yapabilirim ücretli yada ücretsiz olarak yardım istiyorum bu konuda