回复人: feixuehenshui(飞雪恨水) ( ) 信誉:100 2004-3-17 10:40:49
搞定!
<?php
ob_start();
require "main.php";if(!isset($_GET['id']))
{
$tpl->assign('errormsg',"URL路径非法或URL参数错误!");
$tpl->display("error.htm");
exit;
}$tpl->assign('softname',"sdfsdfsd"]);
$tpl->assign('displayname',$result->fields['au_displayname']);
$tpl->display("soft_view.htm");//模版文件}
else{
$tpl->assign('errormsg',"该软件不存在,或者尚未通过验证");
$tpl->display("error.htm");}$str = ob_get_contents();
$fp = fopen('bb.html', 'w'); //将页面信息写到文件中
fwrite($fp, $str);
fclose($fp);
ob_end_clean(); //如果其用它用户的页面将不现实任何的东西
//ob_end_flush();
echo header("Location:bb.html");
?>
搞定!
<?php
ob_start();
require "main.php";if(!isset($_GET['id']))
{
$tpl->assign('errormsg',"URL路径非法或URL参数错误!");
$tpl->display("error.htm");
exit;
}$tpl->assign('softname',"sdfsdfsd"]);
$tpl->assign('displayname',$result->fields['au_displayname']);
$tpl->display("soft_view.htm");//模版文件}
else{
$tpl->assign('errormsg',"该软件不存在,或者尚未通过验证");
$tpl->display("error.htm");}$str = ob_get_contents();
$fp = fopen('bb.html', 'w'); //将页面信息写到文件中
fwrite($fp, $str);
fclose($fp);
ob_end_clean(); //如果其用它用户的页面将不现实任何的东西
//ob_end_flush();
echo header("Location:bb.html");
?>
<?php
ob_start();//这中间可以加你要你的页面代码就可以了。$str = ob_get_contents();
$fp = fopen('bb.html', 'w'); //将页面信息写到文件中
fwrite($fp, $str);
fclose($fp);
ob_end_clean(); //如果其用它用户的页面将不现实任何的东西
//ob_end_flush();
echo header("Location:bb.html");
?>
Apache配置文件可以实 ,运用阿帕奇的从定向配置,可以将你动态地址,自动转向按照一定规则对应的静态页面的地址。但是那些静态页面时必须已经生成好的,Apache好像不能帮你生成静态页面。
RewriteRule /news/(\d+)\.html /news/news\.php\?id=$1 [N,I]
这样就把 http://www.chedong.com/news/234.html 映射到了 http://www.chedong.com/news/news.php?id=234一个更通用的能够将所有的动态页面进行参数映射的表达式是:
把 http://www.myhost.com/foo.php?a=A&b=B&c=C
表现成 http://www.myhost.com/foo.php/a/A/b/B/c/C。
RewriteRule (.*?\.php)(\?[^/]*)?/([^/]*)/([^/]*)(.+?)? $1(?2$2&:\?)$3=$4?5$5: [N,I]
给了地址不仔细看~~~~唉~~~
把 http://www.myhost.com/foo.php?a=A&b=B&c=C
表现成 http://www.myhost.com/foo.php/a/A/b/B/c/C。
RewriteRule (.*?\.php)(\?[^/]*)?/([^/]*)/([^/]*)(.+?)? $1(?2$2&:\?)$3=$4?5$5: [N,I]
--------------------------------------
请问这个
RewriteRule (.*?\.php)(\?[^/]*)?/([^/]*)/([^/]*)(.+?)? $1(?2$2&:\?)$3=$4?5$5: [N,I]
是写在哪?是php程序中,还是在配置文件中?
所以现在都差一点就忘了.
幸亏现在runke () 兄,问出来,让我重新温习了一下.
RewriteRule /news/(\d+)\.html /news/news\.php\?id=$1 [N,I]
这样就把 http://www.chedong.com/news/234.html 映射到了 http://www.chedong.com/news/news.php?id=234一个更通用的能够将所有的动态页面进行参数映射的表达式是:
把 http://www.myhost.com/foo.php?a=A&b=B&c=C
表现成 http://www.myhost.com/foo.php/a/A/b/B/c/C。
RewriteRule (.*?\.php)(\?[^/]*)?/([^/]*)/([^/]*)(.+?)? $1(?2$2&:\?)$3=$4?5$5: [N,I]
好办法