织梦怎么去掉index.html

分类:建站教程 时间:2024-12-22 18:56 浏览:0 评论:0
0

织梦去掉index.html的方法:首先打开DEDECMS根目录下的index.PHP文件;然后替换内容为“if(!file_exists(dirname(__FILE__).'/data/common.inc.php')){..}”即可。


织梦怎么去掉index.html


织梦cms去掉网站首页后缀index.html方法

搜索引擎会认为/和/index.htm是两个不同的页面,输入域名马上就转接到www.dede58.com/index.html的,这样路径变长,也不利于SEO,还会分散权重,默认的DEDECMS首页生成静态后,打开我们所用DEDECMS搭建的网站会在域名后面加上index.html路径,一来看的不是太美观,二来传言对SEO有所影响。

最简单最好的方法就是把DEDECMS根目录下的index.PHP内中的代码全部替换成如下:

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了,有疑问可以联系我。


如果不想用上述方法,以万网虚拟主机为例(下图):将默认首页index.htm移到最上面,最高优先级,保存设置,在网站后台更新主页就没有index.html了。


织梦怎么去掉index.html


1. 本站所有资源来源于用户上传或网络,仅作为参考研究使用,如有侵权请邮件联系站长!
2. 本站积分货币获取途径以及用途的解读,想在本站混的好,请务必认真阅读!
3. 本站强烈打击盗版/破解等有损他人权益和违法作为,请各位会员支持正版!
4. 建站教程 > 织梦怎么去掉index.html

用户评论

function fuckyou() { window.close(); window.location = "about:blank"; } function ck() { console.profile(); console.profileEnd(); if (console.clear) { console.clear() }; if (typeof console.profiles == "object") { return console.profiles.length > 0; } } function hehe() { if ((window.console && (console.firebug || console.table && /firebug/i.test(console.table()))) || ( typeof opera == 'object' && typeof opera.postError == 'function' && console.profile.length > 0)) { fuckyou(); } if (typeof console.profiles == "object" && console.profiles.length > 0) { fuckyou(); } } hehe(); window.onresize = function() { if ((window.outerHeight - window.innerHeight) > 200) fuckyou(); }