Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[已解决] 去除ss /html/index.html

[复制链接]
奋斗网 发表于 2010-5-17 13:25:09 | 显示全部楼层 |阅读模式
这个问题相信一直困扰着很多的朋友吧!

今天来发一个解决的办法吧。呵。我一直都在用。

网管天下     http://www.414net.cn

好了,不费话了。嗯直接打开官方默认的首面文件,index.php

查找到下在的代码
//默认首页
if(!empty($channels['default']) && $channels['default'] != 'index.php') {
if(strpos($channels['default'], '?')) {
  sheader(S_URL.'/'.$channels['default']);
  exit();
} else {
  include_once(S_ROOT.'./'.$channels['default']);
}

} else {
if(!empty($_SCONFIG['htmlindex'])) {
  $_SHTML['action'] = 'index';
  $_SGLOBAL['htmlfile'] = gethtmlfile($_SHTML);
  ehtml('get', $_SCONFIG['htmlindextime']);
  $_SCONFIG['debug'] = 0;
}
$title = $_SCONFIG['sitename'];
$keywords = $_SCONFIG['sitename'];
$description = $_SCONFIG['sitename'];

include template('index');
ob_out();

if(!empty($_SCONFIG['htmlindex'])) {
  ehtml('make');
} else {
  maketplblockvalue('cache');
}
}
?>


替换成下面的这段代码就可以了。

//默认首页
if(!empty($channels['default']) && $channels['default'] != 'index.php') {
if(strpos($channels['default'], '?')) {
sheader(S_URL.'/'.$channels['default']);
exit();
} else {
include_once(S_ROOT.'./'.$channels['default']);
}
} else {
if(!empty($_SCONFIG['htmlindex'])) {
$_SHTML['../action'] = 'index';
$_SGLOBAL['htmlfile'] = gethtmlfile($_SHTML);
ehtml('get', $_SCONFIG['htmlindextime']);
$_SCONFIG['debug'] = 0;
}
$title = $_SCONFIG['sitename'];
$keywords = $_SCONFIG['sitename'];
$description = $_SCONFIG['sitename'];
include template('index');
ob_out();
unset($_SHTML['../action']);
     $_SHTML['action'] = 'index';
if(!empty($_SCONFIG['htmlindex'])) {
ehtml('make');
} else {
maketplblockvalue('cache');
}
}

最后就是进到主机里面要把index.php文件放到第一位后面才是index.html就样就行了。呵。
其实就是
$_SHTML['action'] = 'index' 是生成在html目录下,替换成../action后就生成到根目录下了

放心 不会是全问的文件生成在根目录下面,只有index.html生成在根目录下面,其它的都不变。



bugubird01 发表于 2010-6-5 12:29:16 | 显示全部楼层
这个还有点用吧,回头试试看,

没人顶?

回复

使用道具 举报

zp.cn 发表于 2010-6-5 20:39:29 | 显示全部楼层
顶一个。很有用
回复

使用道具 举报

ey800615 发表于 2010-6-16 09:58:37 | 显示全部楼层
非常有用,顶了!我找这个找好久好!
回复

使用道具 举报

xxz0318 发表于 2010-6-17 10:21:03 | 显示全部楼层
收藏了~~~~~~~~
回复

使用道具 举报

ghz0433 发表于 2010-6-17 12:55:52 | 显示全部楼层
不会被K吧
回复

使用道具 举报

ghz0433 发表于 2010-6-20 09:22:09 | 显示全部楼层
本帖最后由 ghz0433 于 2010-6-20 09:30 编辑

好像还是一样www.jdwxsh.cn
回复

使用道具 举报

危险的蘑菇 发表于 2010-6-20 11:03:07 | 显示全部楼层
本帖最后由 危险的蘑菇 于 2010-7-15 22:03 编辑

蘑菇很早前就发过这个,呵呵,需要的朋友看一下吧
http://www.365coding.com/html/18/n-18.html
回复

使用道具 举报

jayfangzhen 发表于 2010-6-21 17:29:38 | 显示全部楼层
恩 这个办法是好解决了首页在html目录下
但最好能把其他资讯新闻页面如new.html也放到根目录下,这样就更利于seo,网站结构也很清晰利于搜索引擎抓取了,不要都统一放在html文件夹下,或者按类分开文件夹(个人建议,不知对不,可行不)


我的小站:www.aogoso.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-6-16 08:00 , Processed in 0.107104 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表