首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

织梦网站怎么让域名后边的index.html不显示

织梦网站为静态生成类的cms,所以根目录下有一个index.html静态文件,有不奇怪,但显示出来就不对了,一来有损颜值,二来和利SEO,那么我们就来看看如何才能不显示这个小尾巴.

一:在服务器上把首页默认文件index.php 调整到 index.html前边

二:在模版上把涉及到主页目录的链接都用   根目录标签代替,切忌出现index.html

三 :修改index.php为:

/**

* @version $Id: index.php 1 9:23 2010-11-11 tianya $

* @package DedeCMS.Site

* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.

* @license http://help.dedecms.com/usersguide/license.html

*/

if(!file_exists(dirname(__FILE__).'/data/common.inc.php'))

{

header('Location:install/index.php');

exit();

}

//自动生成HTML版

if(isset($_GET['upcache']) || !file_exists('index.html'))

{

require_once (dirname(__FILE__) . "/include/common.inc.php");

$GLOBALS['_arclistEnv'] = 'index';

$row = $dsql->GetOne("Select * From `#@__homepageset`");

$row['templet'] = MfTemplet($row['templet']);

$pv = new PartView();

$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);

$row['showmod'] = isset($row['showmod'])? $row['showmod'] : 0;

if ($row['showmod'] == 1)

{

$pv->SaveToHtml(dirname(__FILE__).'/index.html');

include(dirname(__FILE__).'/index.html');

exit();

} else {

$pv->Display();

exit();

}

}

else

{

header('HTTP/1.1 301 Moved Permanently');

header('Location:index.html');

}

如果还搞不定,欢迎进群讨论

  • 发表于:
  • 原文链接https://kuaibao.qq.com/s/20180930G0JDM500?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券