大家有什么好的rul重写组建推荐么?
本人用的是虚拟主机,不能在服务器上安装软件,及操作iis,所以最好是不用按照软件,不用配置iis的那种url重写组建
我找了很久都没有找到,不知道大家有没有好的推荐,谢谢!!!

解决方案 »

  1.   

    那就用HttpModule的Rewrite组件啊,虽然只能rewrite后缀为aspx之类的.NET文件。
      

  2.   

    <a href="details/123">Link</a>//App_Cpde目录下 
    SimpleRewriter.cs
    public class SimpleRewriter : System.Web.IHttpModule 

    HttpApplication _application = null; public void Dispose() { } 
    public void Init(HttpApplication context) 

    context.BeginRequest += new EventHandler(context_BeginRequest); 
    _application = context; 

    void context_BeginRequest(object sender, EventArgs e) 

    string path = _application.Context.Request.Path; 
    string[] parameters = path.Split(new char[] { '/' }); 
    if (parameters.Length > 2) 

    _application.Context.RewritePath("~/" + parameters[1] + ".aspx?newsid=" + parameters[2]); 

    } }<httpModules>
    <add name="MyRewriter" type="SimpleRewriter, App_Code"/>
    </httpModules>
      

  3.   

    貌似这个要设置一下iis的,也不太好
      

  4.   


    UrlRewriter.NET is a pure .NET component written in C#, and does not require any ISAPI rewrite dll’s to be installed in IIS. You configure rules in a very readable XML format, either in your web.config file or an external rewriter configuration file.需要设置的是config文件,而非iis
      

  5.   

    http://urlrewriter.net/index.php/support/installation/windows-server-2003
    这个上面写是需要配置的哦。。
      

  6.   

    Although you can use UrlRewriter.NET without making any changes to your IIS configuration, you will have a few limitations in the sorts of friendly URLs you can use. In particular, the URL must be mapped to the ASP.NET runtime in order for UrlRewriter.NET to rewrite it. To get the full power of UrlRewriter.NET, configure IIS 6.0 to map all requests to the ASP.NET runtime.
      

  7.   

    Rewrite.dll微软的,拿来就用,简单的很
      

  8.   

    对啊,这个就是要对iis配置的啊
      

  9.   


    这个就是要求对iis进行配置的啊,不是吗?
      

  10.   

    这个只能重写成.aspx后缀的,也不好
      

  11.   

    Although you can use UrlRewriter.NET without making any changes to your IIS configuration, you will have a few limitations in the sorts of friendly URLs you can use. In particular, the URL must be mapped to the ASP.NET runtime in order for UrlRewriter.NET to rewrite it. To get the full power of UrlRewriter.NET, configure IIS 6.0 to map all requests to the ASP.NET runtime. 这话呢意思是不配置IIS就会有限制。
      

  12.   


    我试过了,不配置的话,只能重写成.aspx,还是达不到效果的啊
      

  13.   

    自己重写HttpHandle 在web.config配置下就行了
      

  14.   

    URLRewriter.dll
    IIS加载个文件
    配置在WEB.CONFIG中进行。
    我刚用这个进行重写,效果还不错。
      

  15.   

    用URLRewriter.dll吧
    我刚用这个实现。
    下面网址有具体方法
    http://www.dwww.cn/News/2008-6/20086142054417409.shtml
      

  16.   

    如果不是重写成html或其他IIS不支持的扩展名的,urlrewrite可以实现,比如重写dd.aspx?id=2为*.*/*.aspx,当然,如果你要重写为html或其他的,必须要建立扩展名映射。另一种方法是在app里定义全局的url转向,不过这个不太实际,曾经试过,效果不理想,至于其他的不用动IIS的又能重写为诸如html的倒没找到个好的解决方案,期待...
      

  17.   


    虚拟主机真难啊
    不能安装软件还好,连iis都不给碰。