public static function encode($uri, $dotMode = true)
    {
        if (0 === strpos($uri, 'http')) {
            //return base64_encode($uri);
            if ($dotMode) {
                //order matters here don't change the _4_ position
                $returnValue = str_replace(['#', '://', '/', '.', ':'], ['_3_', '_2_', '_1_', '_0_', '_4_'], $uri);
            } else {
                $returnValue = str_replace(['#', '://', '/', ':'], ['_3_', '_2_', '_1_', '_4_'], $uri);
            }
        } else {
            $returnValue = $uri;
        }

        return $returnValue;
    }