BlogEngine.Core.Web.HttpModules.UrlRewrite.RewriteFilePath C# (CSharp) Method

RewriteFilePath() private static method

Rewrites the incoming file request to the actual handler
private static RewriteFilePath ( HttpContext context, string url ) : void
context System.Web.HttpContext the context
url string the url string
return void
        private static void RewriteFilePath(HttpContext context, string url)
        {
            var awr = Utils.AbsoluteWebRoot;
            url = url.ToLower().Replace(awr.ToString().ToLower(), string.Empty).Replace("files/", string.Empty);
            url = url.Substring(0, url.LastIndexOf(Path.GetExtension(url) ?? "", StringComparison.Ordinal));
            var npath = string.Format("{0}file.axd?file={1}", Utils.ApplicationRelativeWebRoot, url);
            context.RewritePath(npath);
        }