本帖最后由 skyqingtian 于 2010-03-31 22:57:46 编辑

解决方案 »

  1.   

    我也不会,
    URL重写有什么好处-----我的理解是:隐瞒事实真相 
    玩笑而已,请批评指正...
      

  2.   

    这个是我以前总结的希望对你有用啊。
    URL重定向的步骤:
    (1)在Bin中导入cuteeditor.lic 和URLRewriter.dll这两个包;
    (2)配置节点
    节点如下:
    1.在<configuration>中配置
    <configSections>
    <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
    </configSections>
    <RewriterConfig>
    <Rules>
    <RewriterRule>
    <!--节点中的LookFor指的是假的地址,而SendTo中指向的是实际地址-->
    <LookFor>~/do(\d+)\.jsp</LookFor>
    <SendTo>~/ShowNews.aspx?id=$1</SendTo>
    </RewriterRule>
    </Rules>
    </RewriterConfig>
    2.在<system.web>中配置
    <httpHandlers>
    <add verb="*" path="*.jsp" type="URLRewriter.RewriterFactoryHandler, URLRewriter"/>
    </httpHandlers>
      

  3.   

    web.config:<rewrite>
                <rules>
                    <rule name="RewriteUserFriendlyURL_PackageTour_Details" stopProcessing="true">
                        <match url="^insight/([_0-9a-zA-z]+)/([_0-9a-zA-z]+).html$" />
                        <conditions>
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="insight/insight.aspx?folder={R:1}&amp;file={R:2}" />
                    </rule>
                </rules>
            </rewrite>
    index.aspx.cs:public partial class insight : System.Web.UI.Page
    {
        public String PageContant = "";    protected void Page_Load(object sender, EventArgs e)
        {
            
            if (Request["folder"] != null && Request["file"] != null)
            {
                String FilePath = HttpContext.Current.Server.MapPath("~/insight/" + Request["folder"].ToString() + "/" + Request["file"].ToString() + ".htm" );
                
                if (System.IO.File.Exists(FilePath))
                {
                    System.IO.StreamReader SR = new System.IO.StreamReader(FilePath);
                    PageContant = SR.ReadToEnd();            }
            }        if (PageContant.Length < 3)
            {
                PageContant = "page not found.";
            }
        }
    }必须在iis6.0以上,要安装url rewrite mould~
    我自己在用的,确定调试通过
      

  4.   

    这里两篇文章,希望对你有所帮助:IIS URL Rewriting 和 ASP.NET routing(上)
    http://www.cnblogs.com/blodfox777/archive/2010/01/04/iis-url-rewriting-and-aspnet-routing-1.htmlIIS URL Rewriting 和 ASP.NET routing(下)
    http://www.cnblogs.com/blodfox777/archive/2010/01/05/iis-url-rewriting-and-aspnet-routing-2.html
      

  5.   

    楼主可以研究一个 HttpHander 对象;
      

  6.   

    Url重写又称“伪静态”,用的好的话,它可以将你的开发语言隐藏。楼主可以看看这个博客的内容:http://blog.csdn.net/badyue/archive/2007/04/10/1559090.aspx
      

  7.   

    url重写成伪静态的,可以对搜索引擎稍微友好些,有利于seo,其实动态的url百度 google收录也挺好。
    建议楼主看写seo的url伪静态相关内容。推荐url重写控件UrlRewritingNet,很好用。
      

  8.   

    httpHandler 还没有怎么用熟悉啊!