CodeIgniter Forums
sitemap question - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: sitemap question (/showthread.php?tid=91359)



sitemap question - Gardyloo - 07-28-2024

I have a dynamic website designed with Codeigniter 3 and I am working on the sitemap part as a newbie.
I found the library sitemap-php from evert/sitemap-php but I can't make it run.
From now this is what I did, I put the Sitemap.php file into my library folder
In my controller I enter the following
PHP Code:
public function Sitemap(){
$this->load->library('Sitemap'); 
$sitemap = new Sitemap('https://www.mywebsite.com');
$sitemap->setPath('/public_html/Sitemap/'); // I created a folder Sitemap into my public folder
$sitemap->setFilename('sitemap');
$sitemap->addItem('/''1.0''daily''Today');
$sitemap->createSitemapIndex('https://www.mywebsite.com/sitemap/''Today');} 

Then when I go to https://www.mywebsite.com/sitemap/, I have an error 404.

Could you guide me to solve my issue.
Thanks


RE: sitemap question - ozornick - 07-29-2024

Try path /Sitemap/sitemap.xml
And see in file manager where real file located