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

王朝学院·作者佚名  2011-12-23  
宽屏版  字体:  |  |  | 超大  

用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

}

?>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有