apache下的.htaccess:
rewriteengine on
errordocument 404 /404.html
rewritebase /
#信息列表
rewritecond %{query_string} ^(.*)$
rewriterule ^listinfo-(. ?)-(. ?).html$ /e/action/listinfo/index.php?classid=$1&page=$2
#信息内容页
rewritecond %{query_string} ^(.*)$
rewriterule ^showinfo-(. ?)-(. ?)-(. ?).html$ /e/action/showinfo.php?classid=$1&id=$2&page=$3
#标题分类列表页
rewritecond %{query_string} ^(.*)$
rewriterule ^infotype-(. ?)-(. ?).html$ /e/action/infotype/index.php?ttid=$1&page=$2
#tags信息列表页
rewritecond %{query_string} ^(.*)$
rewriterule ^tags-(. ?)-(. ?).html$ /e/tags/index.php?tagname=$1&page=$2
#评论列表页
rewritecond %{query_string} ^(.*)$
rewriterule ^comment-(. ?)-(. ?)-(. ?)-(. ?)-(. ?)-(. ?).html$ /e/pl/index.php?doaction=$1&classid=$2&id=$3&page=$4&myorder=$5&tempid=$6
iis6下的httpd.ini:
[isapi_rewrite]
# 3600 = 1 hour
cacheclockrate 3600
repeatlimit 32
#信息列表
rewriterule ^(.*)listinfo-(. ?)-(. ?).html$ $1/e/action/listinfo/index.php?classid=$2&page=$3
#信息内容页
rewriterule ^(.*)showinfo-(. ?)-(. ?)-(. ?).html$ $1/e/action/showinfo.php?classid=$2&id=$3&page=$4
#标题分类列表页
rewriterule ^(.*)infotype-(. ?)-(. ?).html$ $1/e/action/infotype/index.php?ttid=$2&page=$3
#tags信息列表页
rewriterule ^(.*)tags-(. ?)-(. ?).html$ $1/e/tags/index.php?tagname=$2&page=$3
#评论列表页
rewriterule ^(.*)comment-(. ?)-(. ?)-(. ?)-(. ?)-(. ?)-(. ?).html$ $1/e/pl/index.php?doaction=$2&classid=$3&id=$4&page=$5&myorder=$6&tempid=$7
#搜索伪静态
iis7下的web.config:
nginx下伪静态:
rewrite ^([^.]*)/listinfo-(. ?)-(. ?).html$ $1/e/action/listinfo/index.php?classid=$2&page=$3 last;
rewrite ^([^.]*)/showinfo-(. ?)-(. ?)-(. ?).html$ $1/e/action/showinfo.php?classid=$2&id=$3&page=$4 last;
rewrite ^([^.]*)/infotype-(. ?)-(. ?).html$ $1/e/action/infotype/index.php?ttid=$2&page=$3 last;
rewrite ^([^.]*)/tags-(. ?)-(. ?).html$ $1/e/tags/index.php?tagname=$2&page=$3 last;
rewrite ^([^.]*)/comment-(. ?)-(. ?)-(. ?)-(. ?)-(. ?)-(. ?).html$ $1/e/pl/index.php?doaction=$2&classid=$3&id=$4&page=$5&myorder=$6&tempid=$7 last;
if (!-e $request_filename) {
return 404;
}