关于作者

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

上一篇 / 下一篇  2006-10-27 02:39:37 / 个人分类:PHP

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

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

screen.width-300)this.width=screen.width-300 border=0 alt=click to open in new window>

screen.width-300)this.width=screen.width-300 border=0 alt=click to open in new window>

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

相关阅读:

TAG: PHP

JXQ的个人空间 引用 删除 JXQ   /   2006-10-31 21:22:25
用户多了,很占CPU资源的。
Rimifon的个人空间 引用 删除 Rimifon   /   2006-10-27 09:35:47
如果能在Global.asa中做手脚就好了
 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)