![]() |
Best Way To Add Sitemap - 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: Best Way To Add Sitemap (/showthread.php?tid=62399) |
Best Way To Add Sitemap - bradm - 07-09-2015 I am not the programmer that developed my software but I do have basic knowledge with CI. I want to add a sitemap to my website and I'm not sure how to do this. I Googled a bunch of code and nothing seemed to work. Initially I created a sitemap with another website and tried to upload it. I couldn't find where I should put the sitemap or what to configure to point CI to the sitemap. Ex. website.com/sitemap.xml. How do I go about doing that or should I use a script to generate the sitemap. I'm sorry if this is a really basic question! Thanks, BradM. RE: Best Way To Add Sitemap - ivantcholakov - 07-10-2015 Did you see how PyroCMS does that? RE: Best Way To Add Sitemap - edoramedia - 07-12-2015 Here is how I do it: Before Starting here are some variables and considerations for this specific topic: - I only have one dynamic pages called blog - I have a few static pages Step 1: Controller I create a controller usually calling it seo.php PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Step 2: View PHP Code: <?php echo '<?xml version="1.0" encoding="UTF-8" ?>' ?> Step 3: Route (config/routes.php) In this step I just make sitemap.php be read as sitemap.xml PHP Code: $route['seo/sitemap\.xml'] = "seo/sitemap"; RE: Best Way To Add Sitemap - arma7x - 07-13-2015 Try this one https://github.com/o/sitemap-php Works for me on CI3. I'm just convert this code to Library and use it on my project. RE: Best Way To Add Sitemap - fcodebue - 12-05-2016 (07-13-2015, 12:24 AM)arma7x Wrote: Try this one could you send your library that you created starting from thet? thanks RE: Best Way To Add Sitemap - cartalot - 12-05-2016 i'm using codeigniter with the sitemap php Library. Its awesome and has clear directions: https://github.com/evert/sitemap-php To get you started - Put the SitemapPHP folder in application/libraries Then, in your controller, in your method you call the library like: PHP Code: public function makeSitemap() |