伪静态

 Regex reg = new Regex(@".+Item-(\d+).aspx");

  
       
        var math = reg.Match(HttpContext.Current.Request.Url.AbsolutePath);
        if (math.Success)
        {
            string id = math.Groups[1].Value;
            HttpContext.Current.RewritePath("Item.aspx?lineid=" + id);
        }
        else
        {

            Regex reg2 = new Regex(@".+page-(\d+).aspx");
             math = reg2.Match(HttpContext.Current.Request.Url.AbsolutePath);
            if (math.Success)
            {
                string id = math.Groups[1].Value;
                HttpContext.Current.RewritePath("page.aspx?channel=" + id);
            }
           
        }

你可能感兴趣的:(伪静态)