用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
}
?>
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器