本帖最后由 xujirun 于 2010-3-29 19:12 编辑
我是用supesite来建站的,原来的静态化文件都是生成在/html目录下,搜索引擎也收录不少了。现在我想按分来来放静态化的文件,如下
原来的 http://www.embedstudy.com/html/00/3700.html
现在变成了 http://www.embedstudy.com/topic/2010-3600.html (topic是分类,可能是其他的值 如download等等)
然后我用了笨吧的404.php做重定向,代码如下:
<?php
ob_start();
$url='http://www.embedstudy.com/'; //定义成你的网址就OK!
$a=$_SERVER['HTTP_X_REWRITE_URL'];
$b=array();
$b=explode('/',$a);
$a=$b[count($b)-1];
if(strstr($a,'.html')){
$a=str_replace('.html','',$a);
if(strstr($a,'category-catid-')){
$a=(int)str_replace('category-catid-','',$a);
//header("Location: "."$url"."?category-"."$a");
header("Location:html/00/n-3700.html");
exit;
}else{
$a=strstr($a,'n-')?(int)str_replace('n-','',$a) int)str_replace('joke','',$a);
//header("Location: "."$url"."?viewnews-"."$a");
header("Location:html/00/n-3800.html");
exit;
}
}else
{
//header("Location: "."$url");
header("Location:html/00/n-3900.html");
}
ob_end_flush();
?>
我想请问这样根据规则做了404转向,会不会影响搜索引擎收录,如果会,该如何解决呢?
、
管理员、笨吧帮忙回答下啊 |