• 一、Apache服務器

1-1、Apache 1.x 的用戶請檢查 conf/httpd.conf 中是否存在如下兩段代碼:

LoadModule rewrite_module libexec/mod_rewrite.so
AddModule mod_rewrite.c

1-2、Apache 2.x 的用戶請檢查 conf/httpd.conf 中是否存在如下一段代碼:

LoadModule rewrite_module modules/mod_rewrite.so

1-3、后在配置文件**(通常就是 conf/httpd.conf或者conf/extra/httpd-vhosts.conf)**中加入如下代碼。此時請務必注意,如果網站使用通過虛擬主機來定義,請務必加到虛擬主機配置中去,如果加在虛擬主機配置外部將可能無法使用。改好后然后將 Apache 重啟。
規則如下:

RewriteEngine On 
RewriteBase / 
RewriteRule ^([0-9]+)-([0-9]+).html$            /app/index.php?i=$1&a=webapp&c=entry&eid=$2%1 [L,QSA]
RewriteRule ^([0-9]+)/$				            /app/index.php?i=$1&a=webapp&c=entry&do=index&m=fy_lessonv2 [L,QSA]
RewriteRule ^([0-9]+)/([0-9a-zA-Z]+).html$	    /app/index.php?i=$1&a=webapp&c=entry&do=$2&m=fy_lessonv2 [L,QSA]

 

  • 二、Nginx服務器
    規則如下:
rewrite ^/([0-9]+)-([0-9]+).html$		    /app/index.php?i=$1&a=webapp&c=entry&eid=$2;
rewrite ^/([0-9]+)/$					    /app/index.php?i=$1&a=webapp&c=entry&do=index&m=fy_lessonv2;
rewrite ^/([0-9]+)/([0-9a-zA-Z]+).html$	    /app/index.php?i=$1&a=webapp&c=entry&do=$2&m=fy_lessonv2;

  • 三、IIS7服務器(如果不會配置的請勿使用iis服務器)

配置請參考這里
IIS7服務器偽靜態規則和Apache服務器偽靜態規則一樣,請自行配置