/**
  * Apply configuration rewrites to current url
  *
  * @return bool
  */
 protected function _rewriteConfig()
 {
     $config = $this->_config->getNode('global/rewrite');
     if (!$config) {
         return false;
     }
     foreach ($config->children() as $rewrite) {
         $from = (string) $rewrite->from;
         $to = (string) $rewrite->to;
         if (empty($from) || empty($to)) {
             continue;
         }
         $from = $this->_processRewriteUrl($from);
         $to = $this->_processRewriteUrl($to);
         $pathInfo = preg_replace($from, $to, $this->_request->getPathInfo());
         if (isset($rewrite->complete)) {
             $this->_request->setPathInfo($pathInfo);
         } else {
             $this->_request->rewritePathInfo($pathInfo);
         }
     }
     return true;
 }