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

简介:这是IIS不用rewrite实现页面静态化的方法的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。

class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=322030' scrolling='no'>  

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

“IIS不用rewrite实现页面静态化的方法”的更多相关文章 》

爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具

http://biancheng.dnbcw.info/php/322030.html pageNo:17
原文地址:https://www.cnblogs.com/ooooo/p/2256981.html