首页 > 网站程序 > Supesite7.5伪静态下首页修改为index.html

Supesite7.5伪静态下首页修改为index.html

2009年11月17日

默认的supesite7.5伪静态后首页链接仍然为index.php

不利于搜索引擎

修改原文地址参见:http://www.discuz.net/viewthread.php?tid=1445808

打开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. }

替换如下代码:

  • if($_SCONFIG['urltype'] != 4 && $_SCONFIG['urltype'] != 5) {
  •         $preg_searchs[] = “/href\=\”(\S*?)\/(index\.php)?\?uid\-([0-9]+)\-?(\S*?)\”/i”;
  •         $preg_replaces[] = ‘href=”\\1/?\\3/\\4″‘;
  •         $preg_searchs[] = “/href\=\”\S*?\/(index\.php)?\?(\S+?)\”/ie”;
  •         $preg_replaces[] = “url_replace(’\\2′)”;
  •         $preg_searchs[] = “/href\=\”(\S*?)\/index\.php\”/i”;
  •         $preg_replaces[] = ‘href=”\\1/index.html”‘;
  • }
  • 修改伪静态规则,在原来的伪静态规则中加一条:

     RewriteRule ^/index.html$ /index.php [L]

    到此大功告成

    参见http://www.cjk3d.net/index.html

    cjk3d 网站程序

    1. 本文目前尚无任何评论.
    1. 本文目前尚无任何 trackbacks 和 pingbacks.
    您必须在 登录 后才能发布评论.