Problem sitemap.xml |
Hello,
For my new website, I want to add a sitemap.xml , I can't. Normally it is very simple, I have only 4 pages, so I do not need to automatically generate the sitemap. I use HMVC My controler Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); The file sitemap.xml Code: <?xml version="1.0" encoding="UTF-8" ?> When I lauch the url, http://www.mysite.com/seo/sitemap, I get this error Code: Erreur d'analyse XML : balise ne correspondant pas. Attendu : </meta>. I try to configure the route as I have seen on some forums Code: $route['seo/sitemap\.xml'] = "seo/sitemap"; But, with or without the route configured, it's the same result Thank's for your help Patrice
If it doesn't need to be generated dynamically you could just put sitemap.xml file in the root directory, no need to route to it.
Hello,
Ok I'am to bad, effectively, it works like that, thank you very match. Actually, it works if I put the file in the root directory of my app But if I want to store it in the view folder, do you know if is it possible ? (11-03-2015, 11:13 AM)patguitar Wrote: Hello, You can put xml file in the view folder. Your sitemap() function is correct except to load view file in other format than php, you must specify it PHP Code: $this->load->view('sitemap.xml');
Emplacement : http://localhost/kojite/seo/sitemap <--it errors came from local or already server ?
Hello pdthinh,
Your answer is good and works, for that, I need to set the route : Code: $route['seo/sitemap\.xml'] = "seo/sitemap"; for freddy, If I just use Code: $this->load->view('sitemap'); With or without route, error 404 thank's for your help Patrice
Hello pdthinh,
Your answer is good and works, for that, I need to set the route : Code: $route['seo/sitemap\.xml'] = "seo/sitemap"; for freddy, If I just use the code from local or server Code: $this->load->view('sitemap'); With or without route, error 404 thank's for your help Patrice |
Welcome Guest, Not a member yet? Register Sign In |