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

 找回密码
 立即注册
搜索

[已答复] ss7.0如何实现首页伪静态

[复制链接]
qhdyezhu 发表于 2009-10-16 08:03:56 | 显示全部楼层 |阅读模式
从后台已经设置了伪静态,也实现了全站的伪静态,但是首页却只是一个网址,没有具体页面地址

我想让首页显示为index.html,在伪静态状态下如何设置才能实现呢?

本站地址:www.my0335.com
回复

使用道具 举报

waterliu2006 发表于 2009-10-16 08:33:12 | 显示全部楼层
你设置了默认首页是那个,就不会显示了吧。
回复

使用道具 举报

lidq.jingwu 发表于 2009-10-16 08:44:59 | 显示全部楼层
1# qhdyezhu


    还在受SS生成静态跳转到html/index.html的罪吗(针对独立服务器):https://discuz.dismall.com/thread-1241064-1-1.html
解决SS/XS,dz,uchome首页收录问题,首页定时自动生成纯html文件(针对虚拟主机):https://discuz.dismall.com/thread-1422052-1-1.html
回复

使用道具 举报

 楼主| qhdyezhu 发表于 2009-10-16 08:52:13 | 显示全部楼层
谢谢楼上的兄弟,但是我做的是伪静态,不是真静态

我以前用的是真静态,而且就是用的你说的方法,但是由于虚拟空间的限制,不得不转为伪静态,要说一下的是真静态的收录效果比伪静态好,现在百度收录的多是真静态的页面。甚至首页也是收录的原来真静态时候的index.html,所以,百度收录的首页就没法更新了。总是停留在做伪静态之前的状态。

我想的是在伪静态的状态下,在根目录生成首页伪静态的index.html
回复

使用道具 举报

lidq.jingwu 发表于 2009-10-16 08:54:53 | 显示全部楼层
4# qhdyezhu


    等会儿我试一下,看能否找到办法。
回复

使用道具 举报

 楼主| qhdyezhu 发表于 2009-10-16 08:55:38 | 显示全部楼层
好的,感谢
回复

使用道具 举报

 楼主| qhdyezhu 发表于 2009-10-16 08:56:01 | 显示全部楼层
:)我在线等
回复

使用道具 举报

 楼主| qhdyezhu 发表于 2009-10-16 09:06:17 | 显示全部楼层
怎么样?老大找到了吗?
回复

使用道具 举报

 楼主| qhdyezhu 发表于 2009-10-16 09:31:34 | 显示全部楼层
顶起来,有没有知道的?
回复

使用道具 举报

lidq.jingwu 发表于 2009-10-16 11:55:41 | 显示全部楼层
1# qhdyezhu


    打形式common.func.php文件,找到函数 ob_out ,在函数中找到下面一段代码(272行):
  1. if($_SCONFIG['urltype'] != 4 && $_SCONFIG['urltype'] != 5) {
  2.         $preg_searchs[] = "/href\="(\S*?)\/(index\.php)?\?uid\-([0-9]+)\-?(\S*?)"/i";
  3.         $preg_replaces[] = 'href="\\1/?\\3/\\4"';
  4.         $preg_searchs[] = "/href\="\S*?\/(index\.php)?\?(\S+?)"/ie";
  5.         $preg_replaces[] = "url_replace('\\2')";
  6. }
复制代码
将其修改为:
  1. if($_SCONFIG['urltype'] != 4 && $_SCONFIG['urltype'] != 5) {
  2.         $preg_searchs[] = "/href\="(\S*?)\/(index\.php)?\?uid\-([0-9]+)\-?(\S*?)"/i";
  3.         $preg_replaces[] = 'href="\\1/?\\3/\\4"';
  4.         $preg_searchs[] = "/href\="\S*?\/(index\.php)?\?(\S+?)"/ie";
  5.         $preg_replaces[] = "url_replace('\\2')";
  6.         $preg_searchs[] = "/href\="(\S*?)\/index\.php"/i";
  7.         $preg_replaces[] = 'href="\\1/index.html"';
  8. }
复制代码
修改伪静态规则,在原来的伪静态规则中加一条:
  1. RewriteRule ^/index.html$ /index.php [L]
复制代码
修改后如下:
  1. <IfModule mod_rewrite.c>
  2. RewriteEngine On

  3. ###        Rewrite 系统规则请勿修改
  4. RewriteRule ^/index.html$ /index.php [L]
  5. RewriteRule ^/([0-9]+)/spacelist(.+)$ /index.php?uid/$1/action/spacelist/type$2 [L]
  6. RewriteRule ^/([0-9]+)/viewspace(.+)$ /index.php?uid/$1/action/viewspace/itemid$2 [L]
  7. RewriteRule ^/([0-9]+)/viewbbs(.+)$ /index.php?uid/$1/action/viewbbs/tid$2 [L]
  8. RewriteRule ^/([0-9]+)/(.*)$ /index.php?uid/$1/$2 [L]
  9. RewriteRule ^/([0-9]+)$ /index.php?uid/$1 [L]

  10. RewriteRule ^/action(.+)$ /index.php?action$1 [L]
  11. RewriteRule ^/category(.+)$ /index.php?action/category/catid$1 [L]
  12. RewriteRule ^/viewnews(.+)$ /index.php?action/viewnews/itemid$1 [L]
  13. RewriteRule ^/viewthread(.+)$ /index.php?action/viewthread/tid$1 [L]
  14. RewriteRule ^/mygroup(.+)$ /index.php?action/mygroup/gid$1 [L]
  15. </IfModule>
复制代码
试一下能否成功,成功后给个信儿
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-9-14 15:17 , Processed in 0.121193 second(s), 14 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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