设为首页 加入收藏 网站搜索 繁體中文 中国建站网 — 站长资源平台

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

来源网络收集 作者:佚名 时间:2007-4-25 20:25:30 该文得分0

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

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

用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
}
?>

相关文章
广告赞助
网友评论

共有 0 位网友发表了评论,平均得分: 0 查看完整内容

用户名:

分 值:100分 85分 70分 55分 40分 25分 10分 0分

内 容:

(注“”为必填内容。) 验证码: 验证码,看不清楚?请点击刷新验证码