public static function normalizeUrl($url, $rtrim = true){
		$url = trim($url);
		// replace every back slash with forward slash
		$url = str_replace('\\', '/', $url);
		// replace all double slashes with single
		$url  = preg_replace( '/\/+/', '==DS==', $url );
		// trim slashes on begining
		$segments = explode('==DS==', $url);
		$url = implode('/', $segments);
		//$url = ltrim($url, '/');
		if($rtrim){
			$url = rtrim($url, '/');
		}
		return $url;
	}