页面跳转到index.php,DEDECMS如何解决首页域名跳转到/index.html问题

  • Post author:
  • Post category:php


dedecms默许安装好顺序之后,在浏览器中输入网站拜访网址会跳转到http://域名/index.html ,比如输入http://www.moke8.com会自动跳转到http://www.moke8.com/index.html,这样就呈现了一个页面呈现了两个异样的url的缺点,搜索引擎指南中清晰指出网站url应该为仅有因而要想百度中取得好的体现,那么咱们有必要处置下后面的index.html这个问题;dedecms首页跳转到index.html的解决方法有如下几种:1、在虚拟主机控制面板的默许首文档选项将index.html放在index.php的前面;若是是vps那么就是在iis站点特点的文档选项卡中设置讲index.html移到index.php上面;为什么这样?由于默许首选加载index.php若是顺序没有过错,index.php会履行跳转加载根目录下的inex.html 拜访进程如下域名-域名-域名/index.php-域名/index.html2、linux主机可以使用.htaccess文件设置,如:

deny from all DirectoryIndex index.html index.php3、不让拜访index.php文件的时分做跳转,修正根目录index.php文件 用如下内容进行交换:

if(!file_exists(dirname(__FILE__).’/data/common.inc.php’)) { header(‘Location:install/index.php’); exit(); } 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(); ?>4、用伪静态规矩做跳转将域名/index.html 网址变为域名的方式。这个之前的伪静态规矩中有引见5、删去index.php ,网上都说这个管用,没有实验过。

大叔来温馨提示:如果你正在寻找优秀的织梦模板,那你可以到大叔来的 dedecms模板 频道看看,相信一定有你喜欢的!