- 一、Apache服務(wù)器:
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)**中加入如下代碼。此時(shí)請務(wù)必注意,如果網(wǎng)站使用通過虛擬主機(jī)來定義,請務(wù)必加到虛擬主機(jī)配置中去,如果加在虛擬主機(jī)配置外部將可能無法使用。改好后然后將 Apache 重啟。
規(guī)則如下:
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服務(wù)器:
規(guī)則如下:
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服務(wù)器(如果不會配置的請勿使用iis服務(wù)器):
配置請參考這里
IIS7服務(wù)器偽靜態(tài)規(guī)則和Apache服務(wù)器偽靜態(tài)規(guī)則一樣,請自行配置