url->register('alias', '', '^(.*)$', function ($args) { $o = new dcAliases(); $aliases = $o->getAliases(); $part = $args; foreach ($aliases as $v) { if (@preg_match('#^/.*/$#', $v['alias_url']) && @preg_match($v['alias_url'], $args)) { $part = preg_replace($v['alias_url'], $v['alias_destination'], $args); break; } elseif ($v['alias_url'] == $args) { $part = $v['alias_destination']; break; } } dcCore::app()->url->unregister('alias'); dcCore::app()->url->getArgs($part, $type, $args); if (!$type) { dcCore::app()->url->callDefaultHandler($args); } else { dcCore::app()->url->callHandler($type, $args); } });