protected function _replaceUrlCallback(array $match)
    {
        $assetPath = str_replace(Router::fullBaseUrl(), '', $match[2]);
        $assetPath = trim(FS::clean($assetPath, '/'), '/');
        $appDir    = trim(FS::clean(APP_ROOT, '/'), '/');

        list ($isPlugin, $assetPath) = $this->_getPlgAssetUrl($assetPath);

        if (!$isPlugin) {
            $assetPath = str_replace($appDir, '', $assetPath);
        }

        $assetPath = str_replace(Configure::read('App.webroot'), '', $assetPath);
        $assetPath = FS::clean($assetPath, '/');

        if ($isPlugin) {
            return $this->_normalizePlgAssetUrl($assetPath);
        }

        return $this->_getAssetUrl($assetPath);
    }