1、首先找到include/global.fun.php文件

查找以下内容:

大概在608行:if($rewrite)$uri .= ‘/’;

将其修改为:if($rewrite)$uri .= ‘.html’;

上传global.fun.php 并覆盖原有文件(注意备份)。

2、在网站根目录下创建.htaccess 文件应将如下代码拷贝到其中:

RewriteEngine On
RewriteRule ^info-id-([0-9]+)\.html$ public/info.php?id=$1
RewriteRule ^info-catid-([0-9]+)-page-([0-9]+)\.html$ public/info.php?catid=$1&page=$2
RewriteRule ^info-catid-([0-9]+)-areaid-([0-9]+)-page-([0-9]+)\.html$ public/info.php?catid=$1&areaid=$2&page=$3
RewriteRule ^aboutus\.html$ public/about.php?part=aboutus
RewriteRule ^aboutus-id-([0-9]+)\.html$ public/about.php?part=aboutus&id=$1
RewriteRule ^announce-page-([0-9]+)\.html$ public/about.php?part=announce&page=$1
RewriteRule ^announce-id-([0-9]+)\.html$ public/about.php?part=announce&id=$1
RewriteRule ^faq\.html$ public/about.php?part=faq
RewriteRule ^faq-id-([0-9]+)\.html$ public/about.php?part=faq&id=$1
RewriteRule ^friendlink\.html$ public/about.php?part=friendlink
RewriteRule ^friendlink-action-apply\.html$ public/about.php?part=friendlink&action=apply
RewriteRule ^guestbook-page-([0-9]+)\.html$ public/about.php?part=guestbook&page=$1
RewriteRule ^guestbook-action-write\.html$ public/about.php?part=guestbook&action=write
RewriteRule ^space-([a-z,0-9\-]+)\.html$ public/space.php?user=$1

3、上传.htaccess 文件到根目录。

4、然后再在后台开启伪静态Rewrite功能。

Win系统IIS设置伪静态的方法,将下面的文件存为httpd.ini,上传到根目录。

[ISAPI_Rewrite]

# 3600 = 1 hour
CacheClockRate 3600

RepeatLimit 32

# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP

RewriteRule ^(.*)/index\.html\?*(.*)$ $1/index.php

RewriteRule ^(.*)/info-page-([0-9]+)\/\?*(.*)$ $1/public/info\.php\?page=$2
RewriteRule ^(.*)/info-id-([0-9]+)\/\?*(.*)$ $1/public/info\.php\?id=$2
RewriteRule ^(.*)/info-catid-([0-9]+)-page-([0-9]+)\/\?*(.*)$ $1/public/info\.php\?catid=$2&page=$3
RewriteRule ^(.*)/info-catid-([0-9]+)-areaid-([0-9]+)-page-([0-9]+)\/\?*(.*)$ $1/public/info\.php\?catid=$2&areaid=$3&page=$4

RewriteRule ^(.*)/aboutus\/\?*(.*)$ $1/public/about\.php\?part=aboutus
RewriteRule ^(.*)/aboutus-id-([0-9]+)\/\?*(.*)$ $1/public/about\.php\?part=aboutus&id=$2
RewriteRule ^(.*)/announce-page-([0-9]+)\/\?*(.*)$ $1/public/about\.php\?part=announce&page=$2
RewriteRule ^(.*)/announce-id-([0-9]+)\/\?*(.*)$ $1/public/about\.php\?part=announce&id=$2
RewriteRule ^(.*)/faq\/\?*(.*)$ $1/public/about\.php\?part=faq
RewriteRule ^(.*)/faq-id-([0-9]+)\/\?*(.*)$ $1/public/about\.php\?part=faq&id=$2
RewriteRule ^(.*)/friendlink\/\?*(.*)$ $1/public/about\.php\?part=friendlink
RewriteRule ^(.*)/guestbook-page-([0-9]+)\/\?*(.*)$ $1/public/about\.php\?part=guestbook&page=$2
RewriteRule ^(.*)/space-([a-z,0-9\-]+)\/\?*(.*)$ $1/public/space\.php\?user=$2

清除网站首页缓存–清除前台页面缓存–更新系统缓存,这样就大功告成了!