0
votes

I want to generate xml link for my cakephp site, www.jegeachi.com. I generated this by xml-sitemaps.com from this online tool I am informed that this xml file should be visible at http://jegeachi.com/sitemap.xml. So I do the following steps: in Config/routes.php, I add:

Router::parseExtensions('html', 'rss','xml');

Router::connect("/sitemap", array('controller' => 'frontends', 'action' => 'sitemap', 'ext' => 'xml'));

In frontends Controller I add:

function sitemap() {
        $this->layout ='ajax';
        $this->render('sitemap.xml');
    }

And Finally I upload sitemap.xml into View/Frontends folder. But http://jegeachi.com/sitemap.xml this link is not showing my xml. is my process is wrong? How should I do?

1

1 Answers

0
votes

Why not just

Router::connect("/sitemap", array('controller' => 'frontends', 'action' => 'sitemap'));

And then call and link with ext instead.

The extension will be added as needed automatically.