Welcome Guest, Not a member yet? Register   Sign In
how to create sitemap.xml in codeigniter 4?
#1

how to create sitemap.xml in codeigniter 4?
previously i was using codeigniter version 3 and recently i was using codeigniter version 4, i'm having problem while creating a sitemap.xml there in codeigniter4
Let's stay alive, Even if it's useless.
Reply
#2

quickest way go to : https://www.xml-sitemaps.com/ type in your url to your web. Download sitemap.xml from link; stick it in public , go to google search console and submit simples
CMS CI4     I use Arch Linux by the way 

Reply
#3

yes I know that, my problem here is my sitemap.xml is not read or error
my Controller Sitemap.php
Quote:
Code:
<?php

namespace App\Controllers;


class Sitemap extends BaseController
{
public function index()
{
header("Content-Type: text/xml; charset=UTF-8");
        echo view('sitemap');
}

}
views sitemap

Code:
<?php
  header('Content-type: application/xml; charset="ISO-8859-1"',true); 
?>
<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>https://example.com/</loc>
<lastmod>2022-01-14T21:49:07+01:00</lastmod>
<priority>1.0</priority>
</url>

</urlset>
Let's stay alive, Even if it's useless.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB