Ok I found problem... Problem is in index.php in line like this:
Code: Select all
//See if our page matches any predefined routes
$page = rtrim($page, '/');
//See if our page matches any predefined routes
$page = rtrim($page, '/');
if (strpos($page, '/') !== FALSE)
{
$routes =& $gCms->variables['routes'];
$matched = false;
foreach ($routes as $route)
{
$matches = array();
if (preg_match($route->regex, $page, $matches))
{
//Now setup some assumptions
if (!isset($matches['id']))
$matches['id'] = 'cntnt01';
if (!isset($matches['action']))
$matches['action'] = 'defaulturl';
if (!isset($matches['inline']))
$matches['inline'] = 0;
if (!isset($matches['returnid']))
$matches['returnid'] = ''; #Look for default page
if (!isset($matches['module']))
$matches['module'] = $route->module;
//Get rid of numeric matches
foreach ($matches as $key=>$val)
{
if (is_int($key))
{
unset($matches[$key]);
}
else
{
if ($key != 'id')
$_REQUEST[$matches['id'] . $key] = $val;
}
}
//Now set any defaults that might not have been in the url
if (isset($route->defaults) && count($route->defaults) > 0)
{
foreach ($route->defaults as $key=>$val)
{
$_REQUEST[$matches['id'] . $key] = $val;
if (array_key_exists($key, $matches))
{
$matches[$key] = $val;
}
}
}
//Get a decent returnid
if ($matches['returnid'] == '') {
global $gCms;
$contentops =& $gCms->GetContentOperations();
$matches['returnid'] = $contentops->GetDefaultPageID();
}
$_REQUEST['mact'] = $matches['module'] . ',' . $matches['id'] . ',' . $matches['action'] . ',' . $matches['inline'];
$page = $matches['returnid'];
$smarty->id = $matches['id'];
$matched = true;
}
}
if (!$matched)
{
$page = substr($page, strrpos($page, '/') + 1);
}
}
When I add route like:
Code: Select all
'/galeria-zwyciezcow\/(?P<page>[0-9]+)?$/'
or
'/gallery\/?'
or anything that do not need '/' between start and end of route
and request '
http://host.com/gallery/' or '
http://host.com/gallery' it won't work.
IMHO it's bug.
.htaccess rewrite this to
http://host.com?page=gallery/
next in index.php it is right trimmed so
next
is always false so routes are ommited...
I think routes should be checked always first (regardless if there is '/' or not) before checking a page alias etc.