Supesite7.5伪静态下首页修改为index.html
默认的supesite7.5伪静态后首页链接仍然为index.php
不利于搜索引擎
修改原文地址参见:http://www.discuz.net/viewthread.php?tid=1445808
打开common.func.php文件,找到函数 ob_out ,在函数中找到下面一段代码(272行):
- 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′)”;
- }
替换如下代码:
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]
到此大功告成