注册 | 登录 | 设为首页 | 加入收藏
您当前的位置:飞翔学院-IT中国 → 编程开发PHP → 文章内容

IIS 不用 rewrite 实现页面静态化的方法

作者:佚名 来源:不详 发布时间:2007-11-29 20:39:50

用rewrite做的静态页面实际不存在,iisewrite又不稳定经常404,于是就有了这篇文章。

原理:404页面类型用PHP(Asp也可以),结合小偷,实现页面静态化

IIS 不用 rewrite 实现页面静态化的方法

IIS 不用 rewrite 实现页面静态化的方法

用discuz!论坛archiver举例:
404程序页面:http://bbs.pkxp.com/error.php
演示:http://bbs.pkxp.com/archiver/
error.php源码:

<?php
$url = $_SERVER['QUERY_STRING'];
$url = str_replace("404;","",$url);
if (!ereg ('archiver', $url))
echo "404错误"; 
//404错误页面显示内容
else {       
        $url = str_replace("archiver/","archiver/?",$url);
        $str = file("$url");
        $count = count($str);
        for ($i=0;$i<$count;$i++){
                   $file .= $str[$i];
                }
        echo $file;
//实现archiver/?xx.html 变成archiver/xx.html
}
?>




  • 打印文档
  • 推荐好友
  • 返回顶部
  • 增大字体
  • 减少字体
关于本站 | 工作机会 | 合作网站 | 广告服务 | 市场合作| 联系我们 | 抽奖活动
版权所有: 武汉威俊科技有限公司 Copyright 2005-2007 www.ITCNW.COM All rights reserved