千家信息网

织梦首页index.html去掉的方法

发表于:2025-02-05 作者:千家信息网编辑
千家信息网最后更新 2025年02月05日,小编给大家分享一下织梦首页index.html去掉的方法,希望大家阅读完这篇文章后大所收获,下面让我们一起去探讨吧!织梦首页index.html如何去掉?很多朋友在使用织梦建站或者仿站时都会发现,在访
千家信息网最后更新 2025年02月05日织梦首页index.html去掉的方法

小编给大家分享一下织梦首页index.html去掉的方法,希望大家阅读完这篇文章后大所收获,下面让我们一起去探讨吧!

织梦首页index.html如何去掉?

很多朋友在使用织梦建站或者仿站时都会发现,在访问首页时后面都会添加上index.html

现在我就把这解决办法分享出来,大家可以试一试,看有没有用

推荐学习:织梦cms

在www/ 跟目录下有个自带的index.php文件

原代码

代码如下:

//自动生成HTML版if(isset($_GET['upcache'])){require_once (dirname(__FILE__) . "/include/common.inc.php");require_once DEDEINC."/arc.partview.class.php";$GLOBALS['_arclistEnv'] = 'index';$row = $dsql->GetOne("Select * From `dede_homepageset`");$row['templet'] = MfTemplet($row['templet']);$pv = new PartView();$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);$pv->SaveToHtml(dirname(__FILE__).'/index.html');include(dirname(__FILE__).'/index.html');exit();}else{header('HTTP/1.1 301 Moved Permanently');header('Location:index.html');}?>

把上面的代码替换为

代码如下:

require_once (dirname(__FILE__) . "/include/common.inc.php");require_once DEDEINC."/arc.partview.class.php";$GLOBALS['_arclistEnv'] = 'index';$row = $dsql->GetOne("Select * From `dede_homepageset`");$row['templet'] = MfTemplet($row['templet']);$pv = new PartView();$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);$pv->Display();?>

然后就可以了。

看完了这篇文章,相信你对织梦首页index.html去掉的方法有了一定的了解,想了解更多相关知识,欢迎关注行业资讯频道,感谢各位的阅读!

0