What Url rewriter do you use for ASP.Net? [closed]

試著忘記壹切 提交于 2019-12-02 23:14:30

+1 UrlRewritingNET.URLRewrite -- used in several hundred services/portals/sites on a single box without issue for years! (@Jason -- that is the one you're talking about, right?)

and I've also used the URLRewriter.NET on a personal site, and found it, ah, interesting. @travis, you're right about the changed syntax, but once you get used to it, it's good.

There's System.Web.Routing that was just released with .NET 3.5.

You can just use Request.RewritePath() in a custom HttpModule

I prefer using an IHttpHandlerFactory implementation and have full control over all incoming URLs and where they're mapped to.

If I were starting a new web project now I'd be looking at using MVC from scratch. That uses re-written URLs as standard.

IIS 7 has an URL Rewrite Module that is fairly capable and integrates well with IIS.

I've used UrlRewriting.NET before on a very high-traffic site - it worked great for us. I believe the developers are German, so the English documentation is probably not as good as it could be. I'd highly recommend it.

I've had a good experience with Ionic's ISAPI Rewrite Filter which is very similar to ISAPI_Rewrite, except free. Both are modeled after mod_rewrite and are ISAPI filters, so you can't manage them in code as you have to set them up in IIS.

I would not recommend UrlRewritingNet if you are in an IIS7 Windows 2008 environment.

Reason: UrlRewritingNet requires that you app pool mode = Classic and NOT integrated. This is not optimal Also, their project seems very dead that last 2 years.

I just installed Helicon's ISAPI Rewrite 3. Works exactly like htaccess. I'm diggin it so far.

I used .NET URL Rewriter and Reverse Proxy with great success. It's almost on par with mod_rewrite and uses almost all of the same syntax's. The owner of the project is extremely helpful and friendly and the product works great. This gem provides both Rewriting and Proxy functionality, which many solutions don't offer. IMO, worth a look.

+1 for UrlRewritingNet.UrlRewrite too but why do I always need to end my URL with .aspx? I think it should be improved better regular expression partern.

Why do I always have to end with aspx in virtualURL localhost/Products/Beverages.aspx", "localhost/Products/Condiments.aspx". I just want to type localhost/Products/Beverages", "localhost/Products/Condiments" which look like MVC route.

This one look good but it is not working for my site. I still can't figure it out.

asp.net routing serves the requirement of url rewriting as well and even much more than. With asp.net routing you can not just "rewrite the url" but create custom handlers for various requests. asp.net routing however requires at least asp.net sp1.

The basic thing that you do for a simple routing to work is add a few route handlers in the Application_Start even inside the Global.asax.cs file.

 protected void Application_Start(object sender, EventArgs e)
        {

                        RegisterRoutes(RouteTable.Routes);


        }
        private static void RegisterRoutes(RouteCollection routes)
        {          

            routes.Add("Routing1", new Route("/Blog/id/2","/Blog.aspx"));

        }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!