Best Way To Add Sitemap |
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.
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";
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.
Keep calm.
(07-13-2015, 12:24 AM)arma7x Wrote: Try this one could you send your library that you created starting from thet? thanks
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() |
Welcome Guest, Not a member yet? Register Sign In |