伪静态下不能使用FCKeditor的解决方案ok

发布日期:2010-07-20 作者:mi52.com 人气:

为了SEO,伪静态现在很流行,其中一些朋友采用URLRewriter.dll + IIS设置 .html读取ASPX页,在使用FCKeditor的时候,可能会碰到以下这个问题,就是在编辑器页面出错,提示为:找不到页面/fckeditor/editor/fckeditor.aspx 那是因为正则中把fckeditor.html也替换成aspx的问题,而实际上并不存在后缀为ASPX的文件。针对这些错误,我采用了下面的方法:

  第1步:在正则中优先替换FCK编辑器文件夹的路径,并替换为htm后缀。
     <RewriterRule>
        <LookFor>~/fckeditor/(.*).html</LookFor>
        <SendTo>~/fckeditor/$1.htm</SendTo>
     </RewriterRule>
     <RewriterRule>
        <LookFor>(.*).html</LookFor>
        <SendTo>$1.aspx</SendTo>
     </RewriterRule>
  第2步:为防止出现“没有为扩展名".htm”注册的生成提供程序”的错误,在WEB.CONFIG中加入
    <compilation debug="false">
      <buildProviders>
    <add extension=".htm" type="System.Web.Compilation.PageBuildProvider" />
      </buildProviders>
 </compilation>
  第3步:将fckeditro中所有的html后缀修改为htm,为避免FCK链接中的错误,再用DW将FCK内.html的代码批量替换为.htm
 
  结束语:经修改后,本人的FCK已经能正常使用,但因为FCK内众多功能,并不能一一尝试,有时间的朋友或者追求完美的朋友可以自己多尝试一下。
 
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/fuss228/archive/2009/10/26/4728870.aspx
 
 

返回顶部

拨打电话
首页