Routing 科哈纳3.2路线交通部

Routing 科哈纳3.2路线交通部,routing,kohana-3.2,Routing,Kohana 3.2,我正在为我的Kohana 3.2网站创建动态站点地图,我面临下一个错误。如果我在其中使用点“.”,则路线不起作用。像这样(http://localhost/sitemap.xml): 在这种情况下,一切正常(http://localhost/sitemap): 我怎样才能解决它呢?这将满足您的要求 Route::set('sitemap', 'sitemap.<format>', array( 'format' => 'xml')) ->defaults(array(

我正在为我的Kohana 3.2网站创建动态站点地图,我面临下一个错误。如果我在其中使用点“.”,则路线不起作用。像这样(http://localhost/sitemap.xml):

在这种情况下,一切正常(http://localhost/sitemap):


我怎样才能解决它呢?

这将满足您的要求

Route::set('sitemap', 'sitemap.<format>', array( 'format' => 'xml'))
  ->defaults(array(
     'controller' => 'static',
     'action' => 'sitemap',
  ));

你好,我的回答对你有用吗?
Route::set('sitemap', 'sitemap')
->defaults(array(
'controller' => 'static',
'action' => 'sitemap'));
Route::set('sitemap', 'sitemap.<format>', array( 'format' => 'xml'))
  ->defaults(array(
     'controller' => 'static',
     'action' => 'sitemap',
  ));
Route::set('static', '<action>.<format>', array( 'format' => 'xml'))
  ->defaults(array(
     'controller' => 'static',
     'action' => 'sitemap',
  ));