/// <summary> /// Handles the virtual context for the request /// </summary> /// <param name="relativePath">Relative path</param> /// <param name="excludedEnum">Excluded page enum</param> private static void HandleVirtualContext(ref string relativePath, ref ExcludedSystemEnum excludedEnum) { // Handle the virtual context bool isVirtual = URLRewriter.HandleVirtualContext(ref relativePath); if (isVirtual) { // Check the excluded status excludedEnum = URLHelper.IsExcludedSystemEnum(relativePath); if (excludedEnum == ExcludedSystemEnum.GetFilePage) { VirtualContext.CurrentURLPrefix = null; } } }
/// <summary> /// Rewrites the URL and performs all operations required after URL rewriting. /// </summary> /// <param name="status">Current rewriting status</param> /// <param name="relativePath">Relative path</param> /// <param name="excludedEnum">Excluded page status</param> /// <param name="viewMode">View mode</param> /// <param name="siteName">Site name</param> private static void RewriteUrl(URLRewritingResultEnum status, string relativePath, ExcludedSystemEnum excludedEnum, ViewModeOnDemand viewMode, SiteNameOnDemand siteName) { // Do the rewriting if status not yet determined if (status == URLRewritingResultEnum.Unknown) { RequestHelper.LogRequestOperation("RewriteURL", relativePath, 0); // Rewrite URL status = URLRewriter.RewriteUrl(relativePath, excludedEnum, siteName, viewMode); } // Process actions after rewriting URLRewriter.ProcessRewritingResult(status, excludedEnum, siteName, viewMode, relativePath); }
/// <summary> /// Handles the virtual context for the request /// </summary> /// <param name="relativePath">Relative path</param> /// <param name="excludedEnum">Excluded page enum</param> private static void HandleVirtualContext(ref string relativePath, ref ExcludedSystemEnum excludedEnum) { // Handle the virtual context bool isVirtual = URLRewriter.HandleVirtualContext(ref relativePath); if (isVirtual) { // Check the excluded status excludedEnum = URLHelper.IsExcludedSystemEnum(relativePath); switch (excludedEnum) { case ExcludedSystemEnum.GetFilePage: case ExcludedSystemEnum.GetResource: // Remove virtual context prefix VirtualContext.CurrentURLPrefix = null; break; } RequestHelper.CurrentExcludedStatus = excludedEnum; } }